0

I have a dashboard in grafana (v 8.4.4) that uses InfluxDB with Flux query which looks something like this:

from(bucket: "landscape_sizing")
|> range(start: ${__from}, stop: ${__to})
|> filter(fn: (r) => r["_measurement"] == "old_snapshots")

If I select some range like Last 7 days or Last 90 days, I get no data in the dashboard. If I select absolute time rage and though with fixed dates/time data shows up. The fun part is this query used to work for a while, and as far as I'm aware there were no major changes on either Grafana or Influx side. Is there a way to check what the __from and __to variables in the query are interpred to?

cvyrtik
  • 15
  • 4

1 Answers1

0

You should be able to see that in Grafana, from the visual Inspect -> Query. that should show you the actual query text

Giovanni Luisotto
  • 1,382
  • 7
  • 12
  • thanks, I missed the fact that ${_from} and ${__to} are epoch timestamps in ms, which apparently the flux query doesn't understand. Not sure how exactly that changed. For the time being I've updated the queris in grafana dashboards to ` code` – cvyrtik Aug 15 '22 at 06:57
  • You should still be able to use from and to, just by adding a param, see here https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/#__from-and-__to – Giovanni Luisotto Aug 16 '22 at 07:06
  • sorry, got interrupted on my last comment, I've switched it to ${_from:date} and ${__to:date} – cvyrtik Aug 16 '22 at 07:11