Repository navigation
Export postgres and redis query timing metrics as histograms - #638
Merged
Merged
Conversation
mini-bomba
marked this pull request as ready for review
September 17, 2026 20:59
ajayyy
reviewed
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
currently all we have are rolling averages, which aren't really precise
this PR exports the timings as histograms, which should allow us to see exactly how many slow vs fast queries are executed.
this will make our metrics more resilient to outliers - outliers may greatly inflate the rolling average, but they will be recorded into separate buckets from the "regular" queries
this also has a chance of using less memory than the rolling average - we don't actually need to store the observations for any amount of time - we only count them into a static number of buckets (a single number each) and immediately discard the actual observation value.
this also eliminates the possibility of skipping observations if we make more than
<window size>queries per<scrape duration>- every query will be visible, no matter how many we make and how much time passes between scrapes of the metrics endpoint.