Skip to content

Do not set explicit unit on Prometheus 1.x Metadata #5038

Closed

Description

@jonatan-ivanov

We should not set Unit in the Metadata since if it is set, it must be a suffix of the MetricFamily name separated by an underscore (see OpenMetrics spec).

This can be problematic since Micrometer adds the unit to the name but not necessarily as a suffix. For example, Micrometer does this test_seconds_max but if Unit is present the name should be test_max_seconds. The difference is not having the invalid unit definition on the output (# UNIT test_seconds_max seconds) which would cause scraping errors on the server side (the Prometheus 0.x registry also does this).

Activity

  1. added
    bug
    registry: prometheus
    on May 3, 2024
  2. added this to the 1.13.0 milestone on May 3, 2024
  3. added a commit that references this issue on May 3, 2024
    3512349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregistry: prometheus

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions