How to show “33 minutes ago” on Grafana dashboard with InfluxDB?

Deadly 提交于 2019-12-18 16:49:31

问题


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:

  • Server last reported in: 33 minutes ago
  • Last user sign up: 17 minutes ago

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?


回答1:


Since Grafana(4.6.0) this is now possible with singlestat panels.

  1. GoTo the Options-Tab
  2. Select Value -> Stat -> Time of last point
  3. Select Value -> Stat -> Unit -> Date & time -> From Now




回答2:


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.



来源:https://stackoverflow.com/questions/35640978/how-to-show-33-minutes-ago-on-grafana-dashboard-with-influxdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!