prometheus / prometheus/OpenMetrics

validator doesn't respect a metrics family having zero metrics

Open
#299 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

i have the following open metrics output:

# TYPE metric1 gauge
# HELP metric1 some description
# TYPE metric2 gauge
# HELP metric2 some description
metric2{label="value"} 0.100 1752616860

Running the open metrics validator on this produces the following error:

error for metric family metric1: metric name changed from "metric1" to "metric2"

However in the spec i see the following:

"A MetricFamily MAY have zero or more Metrics. A MetricFamily MUST have a name, HELP, TYPE, and UNIT metadata. Every Metric within a MetricFamily MUST have a unique LabelSet."

Is this a bug in the validator? Or am i misinterpreting the spec?

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 reproducing the validator error with the OpenMetrics exposition shown in the issue, then locate the metric-family validation entry point. Confirm whether a family containing only metadata is accepted while existing checks for families with metrics still pass; add or update coverage for the zero-metric case.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.