micrometer-metrics / micrometer

An application observability facade for the most popular observability tools. Think SLF4J, but for observability.
https://micrometer.io
Apache License 2.0
4.41k stars 976 forks source link

Adopt Stable OTEL Semantic Conventions for JVM metrics #5286

Open lenin-jaganathan opened 1 month ago

lenin-jaganathan commented 1 month ago

Please describe the feature request. In https://github.com/open-telemetry/semantic-conventions/pull/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.

Additional context Related links,

shakuzen commented 1 month ago

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.

ntkoopman commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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.