1

Is it possible to write a InfluxDB query that will give me the number of milliseconds since the last entry in a time series? I'd like to add a single-stat panel in Grafana displaying how old the data is.

Kimble
  • 7,295
  • 4
  • 54
  • 77

1 Answers1

3

I don't think it is possible since you are not able to query the time alone. A influxdb query needs at least one non-time field in a query. You could workaround that by double saving the time in a extra field which you are able to query alone.

But you still want to use now() - "the extra time field". But as far as I found out you also can't use now() inside grafana.

Update: there is a [Feature-Request] now on grafanas github. Make sure to vote it up so it gets implemented one day: https://github.com/grafana/grafana/issues/6710

Update 2: The feature got finaly implemented -> See my answer here: How to show "33 minutes ago" on Grafana dashboard with InfluxDB?

IIIIIIIIIIIIIIIIIIIIII
  • 3,958
  • 5
  • 45
  • 70
  • `select now() - "the extra field" from ...` is an invalid InfluxDB query, giving the error `error parsing query: binary expressions cannot mix aggregates and raw fields`. So currently this is not possible with InfluxDB. – Zepporle Aug 17 '17 at 11:44