-
Notifications
You must be signed in to change notification settings - Fork 890
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
Use total
instead of count
in the metrics semantic conventions
#3457
Use total
instead of count
in the metrics semantic conventions
#3457
Comments
adding this as a JVM runtime metrics stability blocker (to decide one way or another) because of |
@trask what is the stability status of the General Guidelines section? The document is marked "mixed", and other sections are indicated as "stable", but General Guidelines is missing a designation. Presumably its experimental? |
I'm confused by the "use count instead of pluralization" rule:
The definition of "concepts signified by the namespace" seems ambiguous. Examples are given:
When is a namespace different that the concept being counted? Why is Extended to this java example, why can we not think of |
ya, I believe it should be experimental, i'll send a PR to clarify |
I think the difference is that if we use |
Hmm... that could be the intent. I think I disagree. That policy encourages being conservative and including I don't think it's so bad to start with I propose we get rid of the "use count instead of pluralization" rule. |
@reyang I think it would make sense to keep this issue open. Even if that section is marked as experimental, I'd still like to propose changing the recommendation or taking it out entirely as @jack-berg suggested. |
(oops my bad, I didn't realize Fixes #3457 (comment) would close this issue) |
So in terms of impact, this would only change 3 metric semantic conventions, two JVM + one host/system metric. I think in terms of impact vs. gain here, moving to prometheus conventions makes a lot of sense here. |
I think one thing to consider is that |
|
good point. that would leave us with @jsuereth preferred not to add any more prometheus mapping rules, but maybe that's the lesser evil in this case? |
To @jack-berg's suggestion above, is there a downside of having a namespace that is also a metric in and of itself? (Maybe a bad analogy but this makes me think of how REST APIs allow you to interact directly with a collection as well as resources nested underneath it.) I understand the point about wanting to minimize Prometheus mapping rules. |
oh, I think I was getting attribute namespacing rules and metric namespacing rules mixed up. attribute namespaces have this restriction in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-naming.md
but I don't see any similar restriction on metric namespaces in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/README.md |
The |
Just to have the impact recorded, here's the metrics we have today that would need adapting:
|
Related: In Golang's runtime/metrics package, a similar scenario came up. The input consists of two metrics, both cumulative counters, one unitless (objects) and one in bytes.
I've mapped these into:
When these are converted to Prometheus, I get process_runtime_go_gc_heap_allocs_objects_total To get this outcome, I used a namespace as a metric name. |
this was discussed in the specification meeting today, and I've posted a PR with the proposal discussed: #3493 Please add any comments about the PR directly on this issue for now as that PR will be closed and moved to the new semconv repository shortly. |
What are you trying to achieve?
I am working on a project built on OTel and Prometheus (overview blog post here) and am trying to make the metrics I generate fit both OpenTelemetry and OpenMetrics as best as I can. However, there is an unfortunate and seemingly unnecessary divergence between these two standards with regard to the naming of counters.
The OTel semantic conventions say that
count
should be used as a suffix while OpenMetrics mandates that counters end with atotal
suffix. It seems silly that metrics produced with OTel and then exported to Prometheus would end up with a_count_total
suffix.I completely understand if this part of the spec is too far along to change it now. But, if not, I'd like to propose changing the recommendation to say that the word
total
should be used instead. Those two words are pretty close to synonymous so it doesn't seem like it would be that painful to go with the one chosen by OpenMetrics for that extra little bit of compatibility.For what it's worth, I personally prefer the word
count
so I can see why OTel chose it, but I'd opt for the substantive benefit of better compatibility between the standards over that instinct.Additional context.
The Metrics Semantic Conventions say:
OpenMetrics says:
The text was updated successfully, but these errors were encountered: