Skip to content

Conversation

@afhassan
Copy link
Contributor

Every time an arithmetic operation is done on two float64 variables the result is calculated at high precision then rounded to the nearest possible float representation. This error accumulates when summing a large set of series, and can become significant.

In Prometheus, we use Kahan summation to compensate for this error when aggregating SUM operation. We do not do the same currently in Thanos.

Kahan Summation https://en.wikipedia.org/wiki/Kahan_summation_algorithm

@afhassan afhassan marked this pull request as ready for review September 23, 2025 23:03
@yeya24 yeya24 merged commit e9123dc into thanos-io:main Sep 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants