简体   繁体   English

不要使用promQL显示Grafana中重新部署的pod的数据

[英]Don't show data from redeployed pod in Grafana using promQL

I have a PromQL query that is looking at max latency per quantile and displays the data in Grafana, but it shows data from a pod that is redeployed and no longer exists. 我有一个PromQL查询,它查看每个分位数的最大延迟并在Grafana中显示数据,但它显示了已重新部署且不再存在的Pod中的数据。 The pod is younger than the staleness period of 15 days. 吊舱比15天的失效时期还年轻。

Here's the query: max(latency{quantile="..."}) 查询如下: max(latency{quantile="..."})

The max latency found is from the time it was throttling, and shortly after it got redeployed and went back to normal, and now I want to look only at the max latency of what is currently live. 找到的最大延迟时间是从调整时间开始,到重新部署并恢复正常后不久,现在我只想看看当前活动的最大延迟时间。

All the info that I found so far about staleness says it should be filtering behind the scenes, but doesn't look like it's happening in the current setup and I cannot figure out what should I change. 到目前为止,我发现的所有有关陈旧性的信息都表明它应该在幕后进行过滤,但是看起来好像不是在当前设置中正在发生,所以我不知道应该更改什么。

When adding manually in the query the specific instance ID - it works well, but the ID will change once it gets redeployed: max(latency{quantile="...", exported_instance="ID"}) 在查询中手动添加特定实例ID时,它会很好地工作,但是一旦重新部署ID,它就会更改: max(latency{quantile="...", exported_instance="ID"})

Here is a long list of similar questions I found, some are not answered, some are not asking for the same. 这是我发现的一长串类似问题,有些没有得到回答,有些没有要求相同。 The ideas that I did find that are somewhat relevant but don't solve the problem in a sustainable way are: 我确实发现的想法有些相关,但不能以可持续的方式解决问题:

Suggestions from the links below that were not helpful 以下链接中的建议没有帮助

  • change staleness period, won't work because it affects the whole system 更改陈旧期,因为它会影响整个系统,所以将不起作用
  • restart Prometheus, won't work because it can't be done every time a pod is redeployed 重新启动Prometheus,将无法正常工作,因为每次重新部署Pod都无法完成
  • list each graph per machine, won't work with a max query 列出每台计算机的每个图形,不适用于max查询

Links to similar questions 链接到类似问题

The end goal 最终目标

is displaying the max latency between all sources that are live now, dropping data from no longer existing sources. 正在显示当前活动的所有源之间的最大延迟,从而删除不再存在的源中的数据。

You can use auto generated metric named up to isolate your required metrics from others. 您可以使用自动生成的指标命名up以将所需指标与其他指标隔离。 You can easily determine which metric sources are offline from up metric. 您可以轻松确定哪些度量标准来源从up度量标准脱机。

up{job="", instance=""}: 1 if the instance is healthy, ie reachable, or 0 if the scrape failed. up {job =“”,instance =“”}:如果实例正常(即可达),则为1;如果刮擦失败,则为0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用来自 Kubernetes 度量服务器的 PromQL (prometheus) 列出 Grafana 上的命名空间名称、命名空间年龄和状态 - List Namespace name, Namespace Age, and Status on Grafana using PromQL (prometheus) from Kubernetes Metric server 在 Grafana 中显示来自 Prometheus 最后抓取的 Kubernetes Pod 的指标 - Show metrics in Grafana from the Kubernetes Pod that was scraped last by Prometheus 如何在结果中显示确切的变量值 - PromQL/Grafana? - How to show the exact variable value in the result - PromQL/ Grafana? 为什么grafana不显示数据点? - Why grafana doesn't show the data points? Grafana - Promql 累积图 - Grafana - Promql cumulative graph 如何在 Grafana 中不使用聚合函数来使用 promql 组 - How to use promql group by without using aggregate functions in Grafana 在 Grafana 的 Promql 查询中引用选择的时间范围(从、到) - Reference chosen time range (from, to) in Grafana's Promql query 以编程方式使用 python,从 grafana 网站导入 grafana 仪表板数据 - Programmatically using python, import grafana dashboard data from grafana website 使用Grafana从OpenTSDB分析/按摩数据 - Using Grafana to analyse/massage data from OpenTSDB Grafana Promql 直方图分位数查询问题 - Grafana Promql histogram quantile query issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM