Skip to content

[Prometheus] Exporter should support 'NoTranslation' mode #6668

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

Open
ywwg opened this issue Apr 15, 2025 · 3 comments
Open

[Prometheus] Exporter should support 'NoTranslation' mode #6668

ywwg opened this issue Apr 15, 2025 · 3 comments
Assignees
Labels
enhancement New feature or request pkg:exporter:prometheus Related to the Prometheus exporter package

Comments

@ywwg
Copy link

ywwg commented Apr 15, 2025

Problem Statement

Currently the only way to control escaping in the prometheusexporter is to set common/model.NameValidationScheme. This value is deprecated and shouldn't be used this way.

Proposed Solution

We should unify the configuration options with the consensus solutions being implemented in Prometheus and Otel-Collector: Supporting an explicit "NoTranslation" mode that exposes unescaped metrics on the Prometheus endpoint.

The consensus solution involves two booleans and three possible settings:

  1. "no-translation" mode -- native Otel metric and label names
  2. Prometheus-translation mode with suffixes
  3. Prometheus-translation mode without suffixes

The current consensus is not to support NoTranslation + EnableSuffixes. If there is demand for this mode, for instance to prevent metric name collisions, we can add it.

Alternatives

Other methods could be used to control the chosen escaping scheme, like a library global variable, but that's a poor way to control behavior.

Prior Art

OtelCollectorConbtrib's prometheusexporter and prometheusremotewriteexporter are both moving towards config values. Prometheus' otel endpoint similarly will have config-controlled settings.

@ywwg ywwg added the enhancement New feature or request label Apr 15, 2025
@ywwg
Copy link
Author

ywwg commented Apr 15, 2025

Also, can a codeowner please assign me to this bug

@XSAM XSAM added the pkg:exporter:prometheus Related to the Prometheus exporter package label Apr 15, 2025
@dmathieu
Copy link
Member

Related: #6590

You have more context than me here, but I wonder if we need that configuration at all.
In a not-too-far future, this config will only have one possible value, yet we will have to support it until we have a major release.

I know relying on deprecated configs isn't great. When we discussed about that at Kubecon, @bwplotka was considering removing the deprecation notice.

@ywwg
Copy link
Author

ywwg commented May 2, 2025

In a not-too-far future, this config will only have one possible value

I think I drafted this issue badly, conflating the Escaping Scheme configuration with the availability of configuration to determine how metrics can be translated for scraping by prometheus.

See: open-telemetry/opentelemetry-collector-contrib#35459

Currently the predicted end state is three options in the SDK:

  1. "no-translation" mode -- native Otel metric and label names
  2. Prometheus-translation mode with suffixes
  3. Prometheus-translation mode without suffixes

We currently have AddMetricSuffixes already, we just need to add TranslationStrategy similar to prometheus/prometheus#16441. We understand this will require updating the spec per open-telemetry/opentelemetry-collector-contrib#39706.

This is also related to: #6704

I will update the wording of this bug to better reflect the intent.

@ywwg ywwg changed the title [Prometheus] Exporter should expose UTF-8 Escaping Scheme as a config value [Prometheus] Exporter should support 'NoTranslation' mode May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:exporter:prometheus Related to the Prometheus exporter package
Projects
None yet
Development

No branches or pull requests

3 participants