Skip to content

Conversation

@jfsmith-at-coveo
Copy link

@jfsmith-at-coveo jfsmith-at-coveo commented Nov 12, 2025

The Prometheus backend query method does not propagate the timestamp argument passed on from the compute function upstream.

This results in the twin queries used for good/bad ratio method to default to now (see https://github.com/tomoncle/prometheus-http-client/blob/master/prometheus_http_client/prometheus/client.py#L78) separately. In some cases, this very slight delay is sufficient to cause inconsistencies in the SLO calculation.

This problem seems related to issues like #319. The symptoms on my end where exactly the same as #343, though for a Prometheus backend: we observed random spikes of error counts.

As the timestamp argument already existed in the method signature, but was left unused in the code, I assume this is an oversight.

Looking deeper into the code, it turns out that the distribution_cut method did not pass the timestamp argument either to the query method. I initially only tested this with the good_bad_ratio method, so the first version of this fix missed this omission as well.

@jfsmith-at-coveo jfsmith-at-coveo marked this pull request as ready for review November 12, 2025 20:46
@jfsmith-at-coveo jfsmith-at-coveo marked this pull request as draft November 12, 2025 21:18
@jfsmith-at-coveo jfsmith-at-coveo marked this pull request as ready for review November 13, 2025 13:45
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.

1 participant