Skip to content

[Prometheus SPECS] Only one HELP line may exist for any given metric name; Prometheus doesn’t like one metric having different help strings #137

@incertum

Description

@incertum

https://prometheus.io/docs/instrumenting/writing_clientlibs/

"Gauge/Counter/Summary/Histogram MUST require metric descriptions/help to be provided."

https://prometheus.io/docs/instrumenting/exposition_formats/

"All lines for a given metric must be provided as one single group, with the optional HELP and TYPE lines first (in no particular order)."

"Only one HELP line may exist for any given metric name."

https://prometheus.io/docs/instrumenting/writing_exporters/

"Prometheus doesn’t like one metric having different help strings."


While not conforming to any of this doesn't break Prometheus, new guidance shall be to enforce the same HELP line per metric name / MetricFamily and only emit it once without configurability to do otherwise.

However, to maintain backward compatibility, enforcing it is still up for debate. It is stated that "Gauge/Counter/Summary/Histogram MUST require metric descriptions/help to be provided." At the same time, Prometheus works just fine without providing a HELP line, and at a different place in the Prometheus docs, TYPE and HELP are explicitly stated as optional. Note that we would break backward compatibility if we were to enforce a HELP line.

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