Skip to content

Add 'translation_strategy' to PrometheusMetricExporter#262

Merged
MrAlias merged 3 commits intoopen-telemetry:mainfrom
ArthurSens:prom-translation-strategy
Sep 17, 2025
Merged

Add 'translation_strategy' to PrometheusMetricExporter#262
MrAlias merged 3 commits intoopen-telemetry:mainfrom
ArthurSens:prom-translation-strategy

Conversation

@ArthurSens
Copy link
Copy Markdown
Member

@ArthurSens ArthurSens commented Aug 7, 2025

Fixes #261

This PR adds a new configuration option to control how PrometheusMetricExporters expose Prometheus metrics—complying with the spec change open-telemetry/opentelemetry-specification#4533. This new option is meant to replace the already existing options without_units and without_type_suffix, while adding extra control over whether UTF8 characters should be exposed or replaced with underscores.

@ArthurSens ArthurSens requested a review from a team as a code owner August 7, 2025 17:21
@ArthurSens ArthurSens changed the title Add 'translation_strategy' to PrometheusMetricProducer Add 'translation_strategy' to PrometheusMetricExporter Aug 7, 2025
@ArthurSens
Copy link
Copy Markdown
Member Author

The big doubt here is how to proceed with deprecating the existing configuration. The OTel collector already uses the PrometheusMetricExporter schema, so removing those options would mean breaking the Collector configuration. At the same time, the PrometheusExporter schema is marked as experimental... so not sure if there is a concept of "Deprecation" here.

@ywwg
Copy link
Copy Markdown

ywwg commented Aug 12, 2025

Per the OTEL spec SIG, we can mark as deprecated but cannot reasonably remove the old options. We can make sure to emphasize the new options in docs etc, but will have to keep supporting the old code ~forever.

@ArthurSens
Copy link
Copy Markdown
Member Author

Hmmm, I'm not sure if the CI failures are related to my changes. I'm assuming they are not 🤔

@zeitlinger
Copy link
Copy Markdown
Member

Hmmm, I'm not sure if the CI failures are related to my changes. I'm assuming they are not 🤔

No, I have the same error - I'll see if I can fix that

@ywwg
Copy link
Copy Markdown

ywwg commented Aug 21, 2025

github link checker often fails due to timeouts, I see that all the time

@zeitlinger
Copy link
Copy Markdown
Member

github link checker often fails due to timeouts, I see that all the time

this was the fix #276

@ArthurSens
Copy link
Copy Markdown
Member Author

Hi folks, anything I could do here to enable the merge?

@zeitlinger
Copy link
Copy Markdown
Member

zeitlinger commented Sep 9, 2025

This PR is failing because lychee is not pinned

@trask can you add the new lychee setup in this repo?

@codeboten you can ignore the link checker errors for this PR

Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArthurSens, the collector can move to these new options behind a feature gate as per the breaking change policy for the collector https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/coding-guidelines.md#end-user-impacting-changes

@zeitlinger
Copy link
Copy Markdown
Member

Feedback from meeting: This PR can already remove the options instead for deprecating, since the collector isn't using this schema.

@ArthurSens
Copy link
Copy Markdown
Member Author

Feedback from meeting: This PR can already remove the options instead for deprecating, since the collector isn't using this schema.

I'm not sure if I'm missing something, but I'm almost sure it is 🤔.

otelconf, is the go implementation of the spec maintainer here, right? And otelconf is used to build the configuration file of otel-collector:

https://github.com/open-telemetry/opentelemetry-collector/blob/b2ac3f5e1d2bf8a4db9be21d5d34ebf83c3cb5ad/service/telemetry/otelconftelemetry/sdk.go#L9

@MrAlias
Copy link
Copy Markdown
Contributor

MrAlias commented Sep 16, 2025

Feedback from meeting: This PR can already remove the options instead for deprecating, since the collector isn't using this schema.

I'm not sure if I'm missing something, but I'm almost sure it is 🤔.

otelconf, is the go implementation of the spec maintainer here, right? And otelconf is used to build the configuration file of otel-collector:

https://github.com/open-telemetry/opentelemetry-collector/blob/b2ac3f5e1d2bf8a4db9be21d5d34ebf83c3cb5ad/service/telemetry/otelconftelemetry/sdk.go#L9

It isn't otelconf, but otelconf/v0.3.0 that is being used by the collector. That package is not going to change based on these changes. There will be a new otelconf/v1.0.0 (or similarly named) that will contain the changes being introduced here. When the collector upgrades to that different package it can translate to this new configuration definition or itself handle a migration path for its configuration that will match.

The two configurations (this and the collectors) are decoupled and this change will not break the collector's. This was confirmed by @codeboten, the author of most of otelconf and the collector configuration.

@codeboten
Copy link
Copy Markdown
Contributor

The two configurations (this and the collectors) are decoupled and this change will not break the collector's. This was confirmed by @codeboten, the author of most of otelconf and the collector configuration.

Just confirming this, the configuration schema as provided by otelconf was already decoupled in the migration from v0.2.0 to v0.3.0 to support the breaking changes there. The same path can be taken when migrating from v0.3.0 to v1.0.0-rc2 with the breaking changes in this PR.

As discussed in the meeting yesterday, my opinion is that it's better to remove the options now, rather than releasing a 1.0 already including deprecated options.

@ArthurSens
Copy link
Copy Markdown
Member Author

Alright, thanks for the explanation! Let me update the PR

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
…ptions

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
@ArthurSens ArthurSens force-pushed the prom-translation-strategy branch from 8012fd1 to 56ce2e2 Compare September 16, 2025 17:11
@MrAlias MrAlias merged commit 758fdfd into open-telemetry:main Sep 17, 2025
12 checks passed
@ArthurSens ArthurSens deleted the prom-translation-strategy branch September 17, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prometheus: Add Translation Strategy per SDK schema update

5 participants