Skip to content

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:

  1. Create a new folder in the dashboards/ directory.
  2. Copy the __folder.template.jsonnet file from the templates/ directory.
  3. Rename the file to __folder.jsonnet.
  4. Replace the placeholder dashboards and alerts in the dashboards and alerts objects.

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.

  1. Place the JSON file in the dashboards root directory or one of the subdirectories within it.
  2. Note that the file must have a .dashboard.json suffix to be recognized as a dashboard.
  3. Register the dashboard in the respective __folder.jsonnet file by adding an entry for the new dashboard:

    1
    2
    3
    4
    5
    6
    ...
    
    local dashboards = {
      // existing dashboards...
      'your-new-dashboard.dashboard.json': import './your-new-dashboard.dashboard.json',
    }
    

    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.

  1. Place the JSON file in the dashboards root directory or one of the subdirectories within it.
  2. Note that the file must have a .alerts.json suffix to be recognized as an alerting rule group.
  3. Register the alerting rule group in the respective __folder.jsonnet file by adding an entry for the new alerting rule group:

    1
    2
    3
    4
    5
    6
    ...
    
    local alerts = {
      // existing alerting rule groups...
      'your-new-alerting-rule-group.alerts.json': import './your-new-alerting-rule-group.alerts.json',
    }
    

    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.