Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grafana: Add annotation on multiple panels at once

I would like to add an annotation on all panels (graphs) in the Grafana dashboard. I could add annotations manually one-by-one on all panels -- but I hope there is a better way how to do it although I didn't find any information in the official documentation.

I suppose I can write a script using Grafana API to create annotation on all panels in dashboard; however this seems like a complicated workaround more than an actual solution.

Do you know how to easily add annotations on all graphs at once?

like image 593
mrek Avatar asked Jun 17 '20 06:06

mrek


People also ask

Where are Grafana annotations stored?

Annotations are saved in the Grafana database (sqlite, mysql or postgres). Annotations can be organization annotations that can be shown on any dashboard by configuring an annotation data source - they are filtered by tags. Or they can be tied to a panel on a dashboard and are then only shown on that panel.

How do you add a panel to a row in Grafana?

Choose the dashboard that you want to add a panel to. Choose the Add panel icon. Choose Add new panel. The Grafana workspace creates an empty graph panel with your default data source selected.

What are annotations in Grafana?

Annotations provide a way to mark points on the graph with rich events.

How do I create a search bar in Grafana?

To enable filter option open any Grafana dashboard in edit mode. On the right side panel there is tab called Table , under this there is option to enable column filter . Enable it and save it, now you can see filter icon on panel. Click filter icon to see available options.


2 Answers

I struggled with the same, but found the answer here: https://stackoverflow.com/a/50416641/3803228

In short, you have to go to your dashboard settings, and in the "annotations" tab, create a new query... that one will automatically display the annotation in all the dashboard panels.

This is the part that worked to me from @aussiedan

Once you have your deployments being added as annotations, you can display those on your dashboard by going to the annotations tab in the dashboard settings and adding a new annotation source: adding annotation source

configuration

Then the annotations will be shown on the panels in your dashboard: panel showing annotation

result

like image 53
dabug Avatar answered Nov 15 '22 09:11

dabug


  1. add an annotation to a single graph manually, as documented in the grafana docs: https://grafana.com/docs/grafana/latest/dashboards/annotations/#adding-annotations. Make sure to give the annotation a "Tag".enter image description here

  2. Go to Dashboard Settings (gear icon at the top) > Annotations > New Query. Set the Data Source to: "-- Grafana --". Set Filter By to: "Tags". Enter the tag you used in step 1. Save your changes and you're done.

enter image description here

More details in the official grafana docs: https://grafana.com/docs/grafana/latest/dashboards/annotations/#query-by-tag

like image 20
dasl Avatar answered Nov 15 '22 11:11

dasl