[英]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:
我确实发现的想法有些相关,但不能以可持续的方式解决问题:
max
query max
查询 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.