Reputation: 14985
I have recently set up Grafana with InfluxDB. I'd like to show a panel that indicates how long it has been since an event took place.
Examples:
I can get a single metric pretty easily with the following code:
SELECT time, last("duration") as last_duration FROM custom_events ORDER BY time DESC
But I can't seem to get Grafana to do what I want with the time field.
Any suggestions?
Upvotes: 14
Views: 10608
Reputation: 1
In 8.4.0 There is a unit selection that allows you to do this, make sure your timestamp is in milliseconds since the epoch and select From Now
as the unit in the dropdown menu
singlestat pannel expressing time since
Upvotes: 0
Reputation: 4088
Since Grafana(4.6.0) this is now possible with singlestat panels.
Options
-TabValue
-> Stat
-> Time of last point
Value
-> Stat
-> Unit
-> Date & time
-> From Now
Upvotes: 16
Reputation: 3942
Its currently(4.0.3) not possible to show the last timestamp in singlestat panels. But there is an issue for supporting this. Hopefully we will find time to implement this in the future.
Upvotes: 1