Skip to content

Commit

Permalink
docs: add section on importing the Grafana dashboard using the Grafan…
Browse files Browse the repository at this point in the history
…a Helm Chart (#2155)

* add section on setting up Grafana dashboard using the Grafana Helm Chart

From the Grafana spec:
https://github.com/grafana/helm-charts/blob/grafana-8.0.2/charts/grafana/values.yaml#L708-L759

* correct text

* clarify which Helm chart
  • Loading branch information
maritiren authored Jun 25, 2024
1 parent 08afd7f commit 3448c9e
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions docs/tutorials/grafana-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ sum(trivy_image_exposedsecrets)
### Set up Grafana Dashboard for Trivy Operator Metrics

Lastly, we want to visualise the security issues within our cluster in a Grafana Dashboard.
You can either do that manually in Grafana, or using the Grafana Helm chart.

For this, navigate to the Grafana URL http://localhost:3000.
The link to the dashboard in Grafana is [the following.](https://grafana.com/grafana/dashboards/17813)

#### Manually in Grafana

Navigate to the Grafana URL http://localhost:3000.

Username: admin
Password: prom-operator
Expand All @@ -200,8 +205,36 @@ Once you see all the default Dashboards, click `New`, then `Import`.

Here, we will paste the ID of the Aqua Trivy Dashboard: `17813`

The link to the dashboard in Grafana is [the following.](https://grafana.com/grafana/dashboards/17813)

Once pasted, you should see the following Dashboard as part of your Dashboard list: `Trivy Operator Dashboard`
Once pasted, you should see the following dashboard as part of your Dashboard list: `Trivy Operator Dashboard`


#### Using the Grafana Helm Chart

The Grafana Helm chart supports importing the dashboard. To import the dashbaord using the ID, the Helm chart requires both a dashboard provider, as well as the dashboard itself as shown in the snippet below.
In the [Grafana Helm chart documentation](https://github.com/grafana/helm-charts/tree/main/charts/grafana#import-dashboards), you find examples of importing a dashboard with the dashboard ID.

```yaml
grafana:
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: ''
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: false
options:
path: /var/lib/grafana/dashboards/default
dashboards:
default:
trivy-operator-dashboard:
gnetId: 17813
revision: 2
datasource: Prometheus
```
When the Helm chart has been applied, you should see the dashboard as part of your Dashboard list. It is named `Trivy Operator Dashboard`.

![Trivy Operator Dashbaord in Grafana Screenshot](../images/trivy-grafana.png)

0 comments on commit 3448c9e

Please sign in to comment.