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?
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.
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.
Annotations provide a way to mark points on the graph with rich events.
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.
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
Then the annotations will be shown on the panels in your dashboard: panel showing annotation
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".
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.
More details in the official grafana docs: https://grafana.com/docs/grafana/latest/dashboards/annotations/#query-by-tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With