【问题标题】:InfluxDB - Query milliseconds since last data point in a time seriesInfluxDB - 查询自时间序列中最后一个数据点以来的毫秒数
【发布时间】:2017-01-24 21:12:37
【问题描述】:

是否可以编写一个 InfluxDB 查询,它会给出自时间序列中最后一个条目以来的毫秒数?我想在 Grafana 中添加一个单统计面板,显示数据的年龄。

【问题讨论】:

    标签: influxdb grafana


    【解决方案1】:

    我认为这是不可能的,因为您无法单独查询时间。 influxdb 查询至少需要 一个非时间 字段。您可以通过在可以单独查询的额外字段中双倍节省时间来解决此问题。

    但您仍想使用now() - "the extra time field"。但据我发现,你也不能在 grafana 中使用now()

    更新:现在在 grafanas github 上有一个 [Feature-Request]。请务必投票,以便有一天它可以实施:https://github.com/grafana/grafana/issues/6710

    更新 2:该功能最终实现 -> 在此处查看我的答案:How to show "33 minutes ago" on Grafana dashboard with InfluxDB?

    【讨论】:

    • select now() - "the extra field" from ... 是一个无效的 InfluxDB 查询,给出了错误 error parsing query: binary expressions cannot mix aggregates and raw fields。所以目前这对于 InfluxDB 是不可能的。
    猜你喜欢
    • 2021-10-07
    • 1970-01-01
    • 1970-01-01
    • 2019-12-04
    • 2021-08-03
    • 2021-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多