You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenTelemetry Semantic Conventions for JVM metrics #5286
Please describe the feature request.
In open-telemetry/semantic-conventions#569, OpenTelemetry has made JVM metrics stable. It makes sense to adopt the stable semantic convention for OTLPMeterRegistry to keep in line with the OTEL Semantic Convention.
Since in Micrometer we consider changing existing meter names and tags a breaking change, I'm not sure how we would do this outside a new major version. Any ideas?
It makes sense to adopt the stable semantic convention for OTLPMeterRegistry to keep in line with the OTEL Semantic Convention.
I also wouldn't tie a wire format (OTLP) to a semantic convention - I think they should be separate decisions. It should be valid to use OpenTelemetry semantic conventions with a format other than OTLP and it should be valid to use OTLP without using the OpenTelemetry semantic conventions.
Add additional OTEL specific MeterBinder implementations in addition to the JVM ones?
Or add an option to the current ones to output the updated OTEL conventions and leave it to the user to set it?
I am working on something within our organization. It is a bit of hybrid approach with using MeterFilter for renaming existing things and an additional MeterBinder for missing pieces. I can create a follow-up PR if we agree on the approach in this issue.
Yeah, this should be a opt-in thing for the reason @shakuzen mentioned above.
As an alternative to the MeterFilter, I think using a mechanism that is somewhat similar to ObservationConvention might work too but's that is a bigger change and it includes new public API components.
changed the title [-]Adopt Stable OTEL Semantic Conventions for JVM metrics[/-][+]Option to configure OTEL Semantic Conventions for JVM metrics[/+]on Dec 16, 2024
I've updated the labels and issue title. I suppose the most basic implementation might be to add a constructor argument (boolean?) to the relevant MeterBinder implementations so users can choose whether to use the otel semantic conventions for the relevant metrics provided by the MeterBinder. A concern I have is around future changes to the semantic conventions and how we could support that. We are planning to work on addressing that with ObservationConventions, but metrics (not through the Observation API) are outside of the scope of that. Making a MeterFilter is another option, but I think that might be more brittle than something in the MeterBinders themselves - it might depend on being configured in a certain order relative to other MeterFilters. So, I think we're still up for discussing options if anyone has ideas.
Reacted by Lenin Jaganathan, Yuto SASAKI and Alexandre Genon
Hi, @shakuzen last comment summarizes really well the situation.
Not only updating the relevant MeterBinder will be more robust than going for the MeterFilter option, it will also be easier to understand and reduce the cognitive load.
As for the question about the future changes in the semantic convention, why don't we adopt the same approach than the opentelemetry-java project, where a version of the project relies on a set version of the semantic convention ?
As for the question about the future changes in the semantic convention, why don't we adopt the same approach than the opentelemetry-java project, where a version of the project relies on a set version of the semantic convention ?
I think that would be the way to go but I'm not sure I see what question you are replying to.
If it is this one:
Since in Micrometer we consider changing existing meter names and tags a breaking change, I'm not sure how we would do this outside a new major version. Any ideas?
I'm afraid what you are suggesting does not help, changing the existing meter names is still a breaking change.
I was trying to answer the question about how keeping up with the changes in the semantic convention and keep Micrometer aligned.
I'm afraid what you are suggesting does not help, changing the existing meter names is still a breaking change.
I understand this as changing from Micrometer original names to the Semantic Convention being a breaking change. If we consider the idea of using the semantic convention as an opt-in feature (by default keep the Micrometer original names for metrics and attributes) then does it still need to be a breaking change?
The feature being opt-in would definitely work but today we don't have a mechanism for this (assuming OTel does not break things in stable releases).
This mechanism is what we were discussing above in #5286 (comment) and #5286 (comment)
keeping up with the changes in the semantic convention and keep Micrometer aligned.
The issue comes down to expectations. While some users may expect the instrumentation to keep up with changes in conventions, others will expect their metrics dashboards and alerts don't stop working because they upgraded the version of Micrometer. Unlike an API/ABI incompatible change, the compiler/JVM can't warn them about convention breaking changes and it's easy to deploy to production and only realize the consequences afterward. That is why I suggest a better solution would account for the possibility of future breaking changes and make the choice more clear to users in some way. What way is the hard part.
changed the title [-]Option to configure OTEL Semantic Conventions for JVM metrics[/-][+]OpenTelemetry Semantic Conventions for JVM metrics[/+]on Sep 9, 2025
Note that #6682 did not include supporting the OTel semconv for GC time, as there were some things to figure out and we ran out of time for M3. We can follow-up with this, depending on demand for it.
A solution for this was released in 1.16.0-M3. We're looking for feedback on this to make sure what we have makes sense for the upcoming GA release. The sooner we can get feedback the better. Anyone who was looking for this feature, please try it out in the milestone and let us know if it works well for you or could be improved.
Activity
shakuzen commentedon Jul 4, 2024
Since in Micrometer we consider changing existing meter names and tags a breaking change, I'm not sure how we would do this outside a new major version. Any ideas?
I also wouldn't tie a wire format (OTLP) to a semantic convention - I think they should be separate decisions. It should be valid to use OpenTelemetry semantic conventions with a format other than OTLP and it should be valid to use OTLP without using the OpenTelemetry semantic conventions.
ntkoopman commentedon Jul 17, 2024
Add additional OTEL specific MeterBinder implementations in addition to the JVM ones?
Or add an option to the current ones to output the updated OTEL conventions and leave it to the user to set it?
lenin-jaganathan commentedon Jul 17, 2024
I am working on something within our organization. It is a bit of hybrid approach with using MeterFilter for renaming existing things and an additional MeterBinder for missing pieces. I can create a follow-up PR if we agree on the approach in this issue.
Yeah, this should be a opt-in thing for the reason @shakuzen mentioned above.
jonatan-ivanov commentedon Jul 17, 2024
As an alternative to the
MeterFilter, I think using a mechanism that is somewhat similar toObservationConventionmight work too but's that is a bigger change and it includes new public API components.[-]Adopt Stable OTEL Semantic Conventions for JVM metrics[/-][+]Option to configure OTEL Semantic Conventions for JVM metrics[/+]shakuzen commentedon Dec 16, 2024
I've updated the labels and issue title. I suppose the most basic implementation might be to add a constructor argument (boolean?) to the relevant MeterBinder implementations so users can choose whether to use the otel semantic conventions for the relevant metrics provided by the MeterBinder. A concern I have is around future changes to the semantic conventions and how we could support that. We are planning to work on addressing that with ObservationConventions, but metrics (not through the Observation API) are outside of the scope of that. Making a MeterFilter is another option, but I think that might be more brittle than something in the MeterBinders themselves - it might depend on being configured in a certain order relative to other MeterFilters. So, I think we're still up for discussing options if anyone has ideas.
alexgenon commentedon Apr 16, 2025
Hi,
@shakuzen last comment summarizes really well the situation.
Not only updating the relevant
MeterBinderwill be more robust than going for theMeterFilteroption, it will also be easier to understand and reduce the cognitive load.As for the question about the future changes in the semantic convention, why don't we adopt the same approach than the opentelemetry-java project, where a version of the project relies on a set version of the semantic convention ?
jonatan-ivanov commentedon Apr 16, 2025
I think that would be the way to go but I'm not sure I see what question you are replying to.
If it is this one:
I'm afraid what you are suggesting does not help, changing the existing meter names is still a breaking change.
alexgenon commentedon Apr 17, 2025
I was trying to answer the question about how keeping up with the changes in the semantic convention and keep Micrometer aligned.
I understand this as changing from Micrometer original names to the Semantic Convention being a breaking change. If we consider the idea of using the semantic convention as an opt-in feature (by default keep the Micrometer original names for metrics and attributes) then does it still need to be a breaking change?
jonatan-ivanov commentedon Apr 17, 2025
The feature being opt-in would definitely work but today we don't have a mechanism for this (assuming OTel does not break things in stable releases).
This mechanism is what we were discussing above in #5286 (comment) and #5286 (comment)
shakuzen commentedon Apr 21, 2025
The issue comes down to expectations. While some users may expect the instrumentation to keep up with changes in conventions, others will expect their metrics dashboards and alerts don't stop working because they upgraded the version of Micrometer. Unlike an API/ABI incompatible change, the compiler/JVM can't warn them about convention breaking changes and it's easy to deploy to production and only realize the consequences afterward. That is why I suggest a better solution would account for the possibility of future breaking changes and make the choice more clear to users in some way. What way is the hard part.
shakuzen commentedon Sep 2, 2025
I'm working on a proposal in #6682. Feedback is welcome.
[-]Option to configure OTEL Semantic Conventions for JVM metrics[/-][+]OpenTelemetry Semantic Conventions for JVM metrics[/+]shakuzen commentedon Sep 9, 2025
Note that #6682 did not include supporting the OTel semconv for GC time, as there were some things to figure out and we ran out of time for M3. We can follow-up with this, depending on demand for it.
shakuzen commentedon Sep 18, 2025
A solution for this was released in 1.16.0-M3. We're looking for feedback on this to make sure what we have makes sense for the upcoming GA release. The sooner we can get feedback the better. Anyone who was looking for this feature, please try it out in the milestone and let us know if it works well for you or could be improved.