Add support for metric name suffixes for distribution#73
Open
urxvtcd wants to merge 1 commit into
Open
Conversation
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.
Hi there,
I know it's not A HUGE PROBLEM, the library does the job fine (thanks for your work!), but I noticed that the names of the metrics the distribution creates are not in line with recommendations from Prometheus docs. For any metric name given by the user, this library will append three suffixes:
bucket,sum, andcount. Let's consider something like handling an HTTP request.If we go with
http_request_duration_seconds, thenhttp_request_duration_seconds_countlooks weird.If we go with
http_requestthen count looks fine, but sum is off, and we don't follow the recommendation to include the unit in the bucket metric name.So I tried to see if something can be done about it. What I came up with is allowing the user to include the suffixes to use in the reporter options. The metric definitions then looks like this:
Which results in this output:
The PR only includes the bare minimum of code to make it work (no validation, no docs), because I just wanted to ask if this is something you'd be interested in.
Best regards