Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add section on importing the Grafana dashboard using the Grafana Helm Chart #2155

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 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)
Loading