Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upderiv() returns non-zero values even though my data hasn’t changed #1647
Comments
This comment has been minimized.
This comment has been minimized.
|
That sounds like floating point inaccuracy, not much we can do about it. Have you considered using the |
This comment has been minimized.
This comment has been minimized.
|
Ah, |
This comment has been minimized.
This comment has been minimized.
|
On 20 May 2016 at 08:48, Michael Stapelberg notifications@github.com wrote:
Everything in Prometheus is floating point. There are way more chances of running into accuracy issues there.Björn Rabenstein, Engineer SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the explanation. I’m closing this issue as we found an alternative solution ( |
stapelberg
closed this
May 20, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
stapelberg commentedMay 19, 2016
Originally I thought this is a regression, but I see no proof of that — as per syslog, I’ve been using
prometheus, version 0.18.0 (branch: stable, revision: f12ebd6)since the 15th of May, and the issue only now started to appear.I have an alerting rule which looks at changes in state, see https://github.com/robustirc/robustirc/blob/669a278acd264e1e94c7ad8e7a6217be54585488/contrib/prometheus/robustirc_prometheus.rules#L19 for details.
This rule is now firing, even though there weren’t any changes in state.
When having a closer look, it turns out that
deriv()returns values that are very close to 0 (e.g.-0.000000000006047549185814796), but not 0.I ran the following two commands to capture the data and reproduce the issue:
wget -qO- http://localhost:9090/api/v1/query_range\?query\=raft_isleader\{instance\=\"ridcully\"\}\&start\='2016-05-19T18:00:00Z'\&end\='2016-05-19T22:00:00Z'\&step\=15s > /tmp/values.txtvalues.txt
wget -qO- http://localhost:9090/api/v1/query_range\?query\=deriv\(raft_isleader\{instance\=\"ridcully\"\}\[10m\]\)\&start\='2016-05-19T20:00:00Z'\&end\='2016-05-19T22:00:00Z'\&step\=15s > /tmp/deriv.txtderiv.txt
I would have expected
deriv()to return 0 in this specific case.Am I holding it wrong or is this a bug? If the former, do you have any suggestions to improve my alerting rule?