Skip to content

[exporter/prometheus] Implement Prometheus translation strategies. #35459

@ArthurSens

Description

@ArthurSens

Is your feature request related to a problem? Please describe.

Prometheus is introducing support to UTF-8 characters in its newest releases:

  • 2.55.0 has UTF-8 support behind a feature-flag.
  • 3.0.0 has UTF-8 characters enabled by default.

This introduces an opportunity here. prometheusexporter could expose metrics as they are, without need for translations.

Describe the solution you'd like

If the collector receives metrics from an app instrumented with Prometheus SDKs (no utf-8, units already as suffixes), just expose them as they come.

If the collector receives metrics from an app instrumented with OTel SDK (with utf-8 and no suffixes), again just expose them as they come!

For backward compatibility with Prometheus versions < 2.55.0, the exporter should add a config option to continue translating to the old format! Prometheus has configuration options for this, called otlp.translation_strategy, so let's do the same to keep configurations consistent.

Additional context

To allow UTF-8 characters, content negotiation needs to be done by the scraper (usually Prometheus) via the Accept Header: escaping=allow-utf-8. The exposition format is handled by one of our dependencies: prometheus/common, and we're already in the latest version so things will ✨ just work ✨!

All we need to do is just stop translating metrics :)


Blocked on: open-telemetry/opentelemetry-specification#4494

The otel specification is being updated to clarify exactly how these modes should be selected and how they should operate.

Metadata

Metadata

Labels

enhancementNew feature or requestexporter/prometheusnever staleIssues marked with this label will be never staled and automatically removed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions