Skip to content

No translation mode in Prometheus->OTLP conversion #4693

@VihasMakwana

Description

@VihasMakwana

What are you trying to achieve?

This proposal aims to enhance the Prometheus to OTLP by introducing a configurable “no translation” mode. This mode will allow to keep the job and instance labels instead of dropping them after conversion into service.name, service.namespace, and service.instance.id.

Motivation

This is a problem for Prometheus-compatible datastores receiving data in OTLP format. The datastores need to perform an extra step to convert service.name and service.instance.id to job and instance labels for existing PromQL queries to work.

For example. Grafana Mirmir also performs an additional step to convert “service.name” and ”service.instance.id” back to “job” and “instance.”

Preserving original labels allows to:

  • maintain compatibility with existing PromQL queries and dashboards,
  • avoid extra translation steps (e.g., converting service.name back to job)
  • Allow Prometheus users to leverage the power of the OTel collector, without forcing a schema migration to semantic conventions

Additional context.

  • if the message arrives and the exporter has both job/instance labels and the service.* attributes, what do we do then?
    • In this case, since the receiver keeps the job and instance labels on the top of converting them to service.* attributes, then converting them back SHOULD match the original job and instance values.
    • The exporter SHOULD work with existing implementation.

I am opening this issue after discussion with @ArthurSens on open-telemetry/opentelemetry-collector-contrib#42425.

Alternatives

We can alternatively add another option to "preserve labels" on the top of translating it.
There shouldn't be any changes required for prometheus based exporters, as they will convert resource metrics into target_info series and promote resource attributes to labels. In this case, they should be able to convert job/instance attributes to job/instance labels without any issues

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sig-issueA specific SIG should look into this before discussing at the specspec:metricsRelated to the specification/metrics directory

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions