Problem with variable not updated correctly

  • What Grafana version and what operating system are you using?
    Grafana 8.5.25 on docker container.

  • What are you trying to achieve?
    I have some time series influx data coming from telegraf agent to monitor nginx stats.
    The data looks like this:
    nginx,ecs.metric.category=nginx,ecs.swarm=cloud-net,host={host} accepts=877i,active=45i,handled=877i,reading=0i,requests=3370i,waiting=43i,writing=2i 1696484670000000000

I created some dashboards and i want to also have an “all” option to show sum of these stats for all containers hosting nginx.

  • How are you trying to achieve it?
    I created a query variable for the dashboard.
    Refresh on time range
    Include “all” option.
    And since i dont want to show values for old containers i have the following query:
    “SHOW TAG VALUES FROM “nginx” WITH KEY=host WHERE time > now() -10m”

  • What happened?
    After deployment it works fine, but if nginx container moves to another host i can still see the old values of host in the variable (of course with no data)

  • What did you expect to happen?
    The variable would show only “hosts” that had metrics in the last 10 minutes.

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

I think the problem is on how the “time” is calculated and what now() returns. Is there any hint how these two are calculated in Grafana?