Repository navigation
Conversation
First part of a Prometheus metrics backend. Adds helpers that turn tally metric and tag names into valid Prometheus names and build a unique key for a series from its name and labels. Part of uber#161
Adds prometheusReporter, which keeps the latest state of every reported series in memory: counters accumulate the deltas tally reports and gauges keep the latest value. A name reported as two different metric types is logged once and the later type is dropped. Part of uber#161
Adds histogram state to prometheusReporter series and reports tally timers as histograms in seconds, using a configurable set of bucket upper bounds. Part of uber#161
This was referenced Nov 7, 2026
This branch has not been deployed
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.
Depends on #742.
Adds histogram state to each series (non-cumulative bucket counts plus count and sum) and reports tally timers as histograms in seconds, using bucket upper bounds passed to the reporter. Bucket bounds are sorted, deduplicated, and infinite bounds are dropped since Prometheus always adds
+Inf.Testing:
go test -race ./metrics/(timer buckets/sum, bucket setup, timer vs counter type conflict),golangci-lint run ./metrics/...(0 issues),go build ./....Stack (merge in order):
prometheusbackend (HTTP server, Close) and docs (113 lines)Since these come from a fork, each PR is based on
masterand also contains the commits of the PRs before it, so the diff and the size check here include those until they merge. Only the last commit is new in this PR. I'll rebase each one as the earlier ones land. Line counts are additions in non-test files, which is what the size check counts.