increase() in Prometheus sometimes doubles values: how to avoid?

后端 未结 2 1657
花落未央
花落未央 2021-02-05 07:51

I\'ve found that for some graphs I get doubles values from Prometheus where should be just ones:

Query I use:

increase(signups_count[4m])
         


        
2条回答
  •  有刺的猬
    2021-02-05 08:17

    This is known as aliasing and is a fundamental problem in signal processing. You can improve this a bit by increasing your sample rate, a 4m range is a bit short with a 2m range. Try a 10m range.

    Here for example the query executed at 1515722220 only sees the 580@1515722085.194 and 581@1515722205.194 samples. That's an increase of 1 over 2 minutes, which extrapolated over 4 minutes is an increase of 2 - which is as expected.

    Any metrics-based monitoring system will have similar artifacts, if you want 100% accuracy you need logs.

提交回复
热议问题