client_java icon indicating copy to clipboard operation
client_java copied to clipboard

Implement Otel Translation Strategies per spec

Open ywwg opened this issue 4 months ago • 3 comments

ref: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/prometheus.md#configuration

This will allow java users to enable NoTranslation mode for 1:1 otel metric names, if they so choose.

per the discussion on CNCF Slack, when we add documentation for this feature we should make sure to point out that modes without suffixes are technically in violation of the Open Metrics specification and may lead to unpredictable results. Example text for other warnings: https://github.com/prometheus/otlptranslator/blob/main/strategy.go#L25-L60

ywwg avatar Sep 05 '25 17:09 ywwg

I'm not convinced that violating the spec is a great idea. This requires discussion, so I put it on the agenda of the Prometheus dev summit.

fstab avatar Sep 08 '25 08:09 fstab

I have created a PR that supports the OTel translation strategy - but does nothing more

  • it doesn't prevent that _total is stripped from metric names, because OTel SDK is passing a snapshot where the the step of stripping suffixes is already done
  • it only supports prometheus and OpenMetrics exposition formats, because OTel SDK only supports pull

Docs (and warnings) are not added yet.

zeitlinger avatar Sep 08 '25 11:09 zeitlinger

We decided to wait for OpenMetrics 2.0

zeitlinger avatar Nov 07 '25 18:11 zeitlinger