Hi everyone,
I’m working on a Grafana dashboard where all panels are driven by dashboard variables, and I’m trying to find a way to make panel annotations respect those variable values.
Dashboard Setup
I have a dashboard with variables like:
NodeIdSensorChannel
Each panel queries data based on the selected dashboard variables.
For example, my Temperature panel uses a query similar to:
WHERE NodeId = $NodeId
If I select:
NodeId = ABC
the panel displays only the time series for node ABC.
If I then change the variable to:
NodeId = CDF
the panel automatically refreshes and displays only the time series for node CDF.
This part works exactly as expected.
The Problem
Suppose I manually create an annotation on the Temperature panel while:
NodeId = ABC
For example:
- Time: 2026-07-16 10:30
- Description: “Temperature sensor calibration”
The annotation is successfully created.
However, when I later change the dashboard variable:
NodeId = CDF
the panel data correctly changes to node CDF, but the annotation line is still displayed on the panel.
When hovering over it, the description is also shown.
From the user’s perspective, this is misleading because the annotation belongs to node ABC, but it is now being displayed while viewing node CDF.
Expected Behavior
Ideally, annotations should be filtered using the current dashboard variables, similar to how the panel query is filtered.
For example:
When
NodeId = ABC
show only annotations created for ABC.
When
NodeId = CDF
show only annotations created for CDF.
Essentially, I would like annotations to behave like panel query results and automatically update when dashboard variables change.
What I Have Tried
I know Grafana supports:
- Dashboard annotations
- Panel annotations
- Annotation queries
- Tags
However, I couldn’t find a way to make manually created annotations automatically include dashboard variable values (such as NodeId) or filter themselves based on the currently selected variables.
My Questions
- Is it possible to make manual annotations respect dashboard variables?
- Can dashboard variables be attached automatically as annotation tags or metadata when creating an annotation?
- Is there any built-in support for filtering annotations using variables like
$NodeId? - Has anyone implemented a workaround for this?
Possible Workaround I’m Considering
One idea is to build a custom Grafana plugin or backend API where:
- When a user creates an annotation, the current dashboard variable values (NodeId, Sensor, Channel, etc.) are also stored.
- Instead of using Grafana’s built-in annotation storage directly, the dashboard queries a custom annotation source that filters annotations based on the currently selected variables.
Has anyone implemented something similar, or is there a better approach?
I’d appreciate any suggestions or recommended patterns for solving this problem.
Thanks!


