prometheus / prometheus/OpenMetrics

Inconsistent requirements for suffixes

Open
#284 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.5k
Forks
175
PR merge metrics
No merged PRs in 30d

Description

The spec says

The name of a MetricFamily MUST NOT result in a potential clash for sample metric names as per the ABNF with another MetricFamily in the Text Format within a MetricSet. An example would be a gauge called "foo_created" as a counter called "foo" could create a "foo_created" in the text format.

I read this as a counter name MUST NOT end in _created, because this results in a potential clash.

However, the spec also says

Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use.

Suffixes for the respective types are:

  • Counter: '_total', '_created'
  • Summary: '_count', '_sum', '_created', '' (empty)
  • Histogram: '_count', '_sum', '_bucket', '_created'
  • GaugeHistogram: '_gcount', '_gsum', '_bucket'
  • Info: '_info'
  • Gauge: '' (empty)
  • StateSet: '' (empty)
  • Unknown: '' (empty)

Here it says SHOULD NOT.

It would be good to have more clarity whether a suffix like _created is allowed in a metric name or not.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the two cited requirements in the OpenMetrics specification, including the ABNF and the listed text-format suffixes. Determine whether _created and the other suffixes are prohibited or merely discouraged, then update the relevant specification wording so the permitted naming rule is unambiguous.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.