Skip to content

Prometheus exporter: Use OTel Resource for target_info #929

@dashpole

Description

@dashpole

From the OTel prometheus spec, resource attributes should be used to make a target_info metric:

In SDK Prometheus (pull) exporters, resource attributes SHOULD be converted to a single target_info metric; otherwise, they MUST be dropped, and MUST NOT be attached as labels to other metric families. The target_info metric MUST be an info-typed metric whose labels MUST include the resource attributes, and MUST NOT include any other labels. There MUST be at most one target_info metric exposed on an SDK Prometheus endpoint.

The current implementation adds resource attributes to all metrics on the endpoint. The OpenMetrics spec says we can't do that:

Exposers MUST NOT add target metadata labels to all Metrics from an exposition, unless explicitly configured for a specific ingestor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metricsArea: issues related to metrics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions