Can we only show annotations on the panel they were created for?

We’d like to only display annotations on the panel they’re created for – this looks like functionality that already exists somewhere since it works as expected for alert annotations (they’re only on the dashboard that generated them).

We’d like to do the same thing, where when we filter annotations by tag, the annotations only display on the panel they’re assigned to in the DB. I’m aware of https://github.com/grafana/grafana/issues/717, but more so wondering where the logic for alert annotations lives so I can modify it until an official PR is accepted.

If you create an annotation on a graph it will only show on that graph. But if you add an annotation query (based on tags) they will be shown on all graphs.

Thanks @torkel – That’s the situation we’re in yeah. Could you help me find where that logic is in the project so we can customize it internally? Even if we have to lose the global annotations in the process, that seems like a positive trade-off. I’m not sure when we’d ever really want to see tagged annotations on every single panel in a dashboard.

But then why add the custom annotation query in the first place? By default graphs will only show annotations that was created on that panel.

A simple use-case for this is if we wanted to tag alert annotations. Suppose an alert fired for panel 1 because we had an unplanned outage, and an alert fired for panel 2 because of a scheduled maintenance.

If we have an annotation query for tags planned & unplanned, it makes sense that we’d only expect to see annotations with the tag unplanned only on the panels they were created for; i.e., I don’t really care about the unplanned annotation on panel 2 because it didn’t affect panel 2’s metrics (i.e., panel 2 didn’t alert on anything).


To give a more robust example, we’ve added a pipeline that transforms alert annotations into regions, and tags those regions with environment variables (dev, prod, etc.). Our dashboard has annotation queries for these – however, since these were generated from alerts, we want that annotation to stick for the panel that alerted. As it works currently, as soon as we try to query say “all production alerts”, simply because they’re tagged as prod, we see the annotations on all panels, not just the panels that alerted (making it quite confusing on what alerted).

The end goal is that we want to be able to tag annotations while preserving which panel that annotation alerted for.

I second this request. In my case I have can have a dashboard with two panels: memory and CPU usage. Data (incl. annotations) are fetched from a custom datasource; when the CPU/memory usage goes out of thresholds, an alert is fired and this is represented as an annotation. However with a single query per dashboard (instead of per panel) a memory exceeded event is shown in both panels and I find out only after reading the description, hovering on the annotation.