Skip to content

OpenMetrics: _total suffix repeated multiple times #605

@k-meister

Description

@k-meister

Description

Today we faced the problem with counter export in openmetrics format: counter names keep being appended by "_total" suffices, one time for every new labelset.

This is how it looks in grafana metric browser after being collected by prometheus

Screenshot

Debug

The problem seems to be around the line
https://github.com/vesari/common/blob/6a86956d41af916f0c048f4988d93994bb865b9e/expfmt/openmetrics_create.go#L255
which modifies metric name inside the loop,

and was introduced in this commit.

Affected versions

github.com/prometheus/common v0.50.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions