最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

grafana - How to define a relative time range in Grafna mySQL query - Stack Overflow

programmeradmin2浏览0评论

I am trying to create a panel that displays the results of a db relative to now. From now-180d to now+30d. This is used for displaying forecasting. The time range is specific to this panel, defined inside the query and not taken from the timerange selector field on top.

SELECT date AS time, namespace, value FROM pnf_vnf_forecasting WHERE date BETWEEN $__timeFrom(now-180D) AND $__timeTo(now+30D) AND namespace IN($PGW) ORDER BY time ASC

Tried this query but the date between sections do not seem to take any effect. I read the documentation and it seems that timeFrom and timeTo take their values from time range field.

I changed the query options and was able to see relative to now and ignore the time range field but cannot display future values.

How can this be done?

发布评论

评论列表(0)

  1. 暂无评论