You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何补全PromQL语句计算http_counters当前与1天前的差值(无数据按0计)

补全后的PromQL语句
http_counters{} - (http_counters{} offset 1d or on(node, status) vector(0))
核心部分解释
  • on(node, status):指定按node和status两个标签维度进行匹配,确保差值计算严格对应相同标签组合的指标,同时保留这两个标签维度。
  • vector(0):当1天前对应标签组的指标无数据时,用0填充,避免因为缺失数据导致该标签组的差值结果被过滤掉。

内容的提问来源于stack exchange,提问作者progquester

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 05:12:03