-
Notifications
You must be signed in to change notification settings - Fork 13
Constant costs might decrease due to numerical instabilities #12
Comments
Adopted workaround:
|
The problem is even worse. Due to these instabilities it could happen that counters got smaller values when it should be constant. This results in a counter reset and totally invalidates the results of the |
* fix for #12 * adapted changelog for the release
Released v0.4.1 to fix the issue. |
Going to integers reduced the probability of the problem to occur, but we might still see flaps and counter resets as a result. Essentially, these are items that are constant in reality (resources that have been decommissioned) but the resulting value flaps around an integer border. |
We are using the following aggregation rules as a workaround right now:
|
I think i ruled out that the non-commutativity of floats is the problem. Could track down the flaps to occur only during updates of the API. Also, I wasn't able to reproduce the flapping with python floats. So I suspect the server-side has the issue and not the code that aggregates. However rounding or truncating in some way might fix it. |
Exported data contains long floating point numbers such as
0.0000032120027740023963
. Due to the nature of the floating points numbers, aggregating those can lead to unstable results as the addition is non-commutative. This is problematic as it prevents us from defining meaningful aggregation rules over exported cost data.Please see prometheus/prometheus#2951 for details.
We don't need full precision here, so we should round the results to 2 or 3 digits before emitting.
The text was updated successfully, but these errors were encountered: