【问题标题】:Prometheus get last value recorded for metricPrometheus 获取度量的最后记录值
【发布时间】:2020-02-12 12:13:52
【问题描述】:

我不确定这是否可能,我很高兴知道是否是这种情况,但是:

假设我有一个 14 天前最后一次看到的指标。如何查询普罗米修斯在特定范围(即 30 天)内的最后一个值,它的日期是什么?

【问题讨论】:

    标签: prometheus


    【解决方案1】:

    自 2.2.0(2021 年 3 月)prometheus 发布以来,“last_over_time”允许您准确检索所需内容:

    last_over_time(my_metric[14d])

    文档:https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

    【讨论】:

      【解决方案2】:

      您似乎希望从一段时间内获取 Prometheus 在其存储中的原始指标。 extracting raw samples from prometheus.

      【讨论】:

      • 哇!确切地!非常感谢
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-19
      相关资源
      最近更新 更多