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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EXPORTER] Prometheus: Add unit to names, convert to word #2213
[EXPORTER] Prometheus: Add unit to names, convert to word #2213
Changes from 9 commits
06b2288
fb15283
41dda7b
8da0585
c0dea97
ac9a1aa
1102d09
8fb3e8a
f34923c
638c5c9
54a5686
cd310b9
71638d4
53c1fa3
498caad
cc949cc
c80ebb9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to use
std::move(data.second)
here?::prometheus::MetricFamily
may contains a lot of data, and copy these data may have performance problem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work if the metric has a unit? E.g. if I have a metric:
foo.bar.total
, with units
, will I getfoo_bar_total_seconds_total
orfoo_bar_seconds_total
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dashpole the output will be
foo_bar_total_seconds_total
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you would trim _total from counters before appending the unit, and then always add _total after the unit for counters.