-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Naming conventions: _total vs. _count #2465
Comments
You should generally avoid naming a metric with a Not sure if it is more confusing than useful to explain that on the "Metric and label naming" page. Maybe we should just list suffixes to avoid (_count, _sum, _bucket, and also _total for non-counters). I'll change the title accordingly. |
Thank you for the clarification! Good to know that What would you use if you currently only want sum + count (because a metric for the average is enough for the moment), but might want to introduce a histogram in the future? If you start with "_sum" and "_count", you could keep using them if you switch to a histogram later. Or are there subtle differences about a "naive"/manual count metric implemented as a counter and the "_count" metric published as part of a histogram? |
If you just have sum + count, I would use a summary without quantiles. That's the most canonical way of representing it. |
The Metric and label naming documentation page states that "an accumulating count has a
total
as a suffix".The Histograms and summaries best practice page however uses
_count
as the suffix for a counter.Are these two recommendations not contradictory? Is the count+sum pair an exception to the general counter case, and thus warrants its own suffix? (If that's the case, it would probably make sense to mention that in the "Metric and label naming" page).
The text was updated successfully, but these errors were encountered: