Deploy Dashboards & Alerts¶
Where Do I Place My Resources¶
To keep Grafana clean and organized for everyone, we require you to place your dashboards and alerts in dedicated
folders in Grafana. If you don't already have a folder for your resource, you have to create a new one. Creating folders
can be done in this repository. The folder structure in this dashboards/ directory is replicated in Grafana
automatically (if configured correctly). Follow these steps to provision a new folder:
- Create a new folder in the
dashboards/directory. - Copy the
__folder.template.jsonnetfile from thetemplates/directory. - Rename the file to
__folder.jsonnet. - Replace the placeholder dashboards and alerts in the
dashboardsandalertsobjects.
That's it, the generator is now aware of your new folder. Now continue to the next sections to add dashboards and alerts for deployment!
Deploy a New Dashboard¶
We assume you have created a dashboard in Grafana and exported it as JSON or otherwise obtained the JSON representation of the dashboard, through development as code for example.
- Place the JSON file in the
dashboardsroot directory or one of the subdirectories within it. - Note that the file must have a
.dashboard.jsonsuffix to be recognized as a dashboard. -
Register the dashboard in the respective
__folder.jsonnetfile by adding an entry for the new dashboard:The left side is the output filename, and the right side is the path to the JSON file you added in step 1. These should match.
That's it! The generator is now aware of your new dashboard and will include it in the generated output. You can verify
this by running mise run dashboards:generate and checking the output directory for the new dashboard file.
Add a New Alerting Rule Group¶
Warning
With the new Observability Platform we use Grafana Unified Alerting for alerting purposes. This is a very different experience from what you're used to in the Legacy Grafana environment. For us it's also still new and we're actively developing around this framework to create an experience that is tailored to KNMI and you and our needs. This means we currently mark Alerting in our Observability Platform as experimental. You are free to use this feature and we encourage experimenting, we want to learn from you as well, but please be aware that the Alerting experience is subject to change, including breaking ones.
This workflow is similar to adding a new dashboard.
We assume you have created an alerting rule group in Grafana and exported it as JSON or otherwise obtained the JSON representation of the alerting rule group, through development as code for example.
- Place the JSON file in the
dashboardsroot directory or one of the subdirectories within it. - Note that the file must have a
.alerts.jsonsuffix to be recognized as an alerting rule group. -
Register the alerting rule group in the respective
__folder.jsonnetfile by adding an entry for the new alerting rule group:The left side is the output filename, and the right side is the path to the JSON file you added in step 1. These should match.
That's it! The generator is now aware of your new alerting rule group and will include it in the generated output. You
can verify this by running mise run dashboards:generate and checking the output directory for the new alerting rule
group file.