Most recent value or last seen value

后端 未结 4 1292
太阳男子
太阳男子 2021-01-04 03:19

Prometheus is built around returning a time series representation of metrics. In many cases, however, I only care about what the state of a metric is right now<

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 04:16

    To get the most recent value of my_metric older than 5m without resorting to hacky PromQL queries, you can modify the query.lookback-delta Prometheus option which is where this default 5m value is defined.

    For example, specifying --query.lookback-delta=1d in your Prometheus launch options and restarting the service will cause the PromQL query my_metric to return the most recent value of my_metric looking back 24 hours.


    Metrics outside this "look-back time window" are called stale.

提交回复
热议问题