Troubleshooting Annotations for Discordant Sequences in Grafana Panel

Hey everyone!

I’m currently working on displaying annotations in my Grafana panel and I’m facing a bit of a challenge. I have a dataset in InfluxDB with the following:

Field: sensor_reading
Tags: sensor_name, sensor_discord

The sensor_discord tag is added only when a particular sequence is discordant. Now, I’m trying to display these discords using annotations.
I have a template variable named sensor which contains the name of the sensor. I’ve attempted to pass the tag in the annotation query, but it’s not working as expected.

Additionally, I’ve tried to filter the discord for the particular sensor using the following query:

from(bucket: "dynamic_discords")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "loss_per_signal")
  |> filter(fn: (r) => r["_field"] == "sensor_reading")
  |> filter(fn: (r) => r["sensor_name"] == ${sensor})
  |> filter(fn: (r) => r["sensor_discord"] == "discord")

But it’s not showing the annotations.

Any ideas on how I can make this work?

Thanks in advance for your help!