图表显示一个不可能的增长。

huangapple go评论58阅读模式
英文:

graphing an impossible increase

问题

我正在绘制代码:500's。我有一个带有以下内容的系列

response_total{job="linkerd-proxy", status_code="500"}

我得到的线非常简单。从5开始增加到6,然后继续保持在6。到目前为止还好。

但后来我将查询更改为以下内容

increase(response_total{job="linkerd-proxy", status_code="500"}[60s])

我期望得到一条线,从0开始,在事件发生时短暂地增加到1,然后回到0。但实际上它升高到了2。如果我将60秒更改为120秒,它仅升高到1.33333。为什么会这样?

我理解"increase"的作用是它获取特定时间的数据点并减去该时间之前X秒的数据点。因此,时间的长度不应该影响结果,而且数值只能为5或6,那么这些数字是从哪里来的呢?

英文:

I am graphing the code:500's. I have one series with this

response_total{job="linkerd-proxy", status_code="500"}

The line I get is very simple. Starts at 5 and increases to 6 then continues on at 6. Ok so far.

But then I change the query to this

increase(response_total{job="linkerd-proxy", status_code="500"}[60s])

I expected a line that starts are 0 bumps up to 1 for a short bit at the time of the event, then goes back to 0. But instead it bumps up to 2. And if I change 60s to 120s it only bumps up to 1.33333. Why does it do that?

My understanding of "increase" is that it takes the datapoint at the time and subtracts the datapoint at Xs before the time. So the length of that time shouldn't matter, and of course the value can only be 5 or 6, so where are these numbers coming from?

答案1

得分: 1

以下是翻译好的内容:

一些进一步的搜索发现这里有一些问题,起初听起来不太相同,但可以解释我所看到的情况。以下是一个相当好的例子。

https://stackoverflow.com/questions/38665904/why-does-increase-return-a-value-of-1-33-in-prometheus?rq=1

一般来说,如果实际数据点距离范围的两端太远,Prometheus会对值进行外推。这些值最终会影响数学运算。

英文:

Some more searching found questions on here that didn't sounds the same at first, but can explain what I am seeing. Here is a pretty good one.

https://stackoverflow.com/questions/38665904/why-does-increase-return-a-value-of-1-33-in-prometheus?rq=1

In general, Prometheus is extrapolating values if the real datapoints are too far from the ends of the range. Those values end up messing with the math.

huangapple
  • 本文由 发表于 2023年2月18日 10:31:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/75490821.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定