Skip to content

Conversation

@yeya24
Copy link
Contributor

@yeya24 yeya24 commented Feb 9, 2026

What this PR does:

Extract ValidateMetricName from ValidateLabels and apply its validation before removing empty label (added in #7069).

Today, if we send a series with only one empty metric name label {__name__=""}. It is validated as a 200 because the empty label will be stripped and distributor will continue when there is no label left.

However, the expected behavior is that we should return 400 in this case to reject empty metric name value. To do it, the metric name validation should happen before removing empty label values from the series.

This edge case is caught via the Prometheus compliance test suite for remote write. https://github.com/prometheus/compliance/tree/main/remotewrite

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@dosubot dosubot bot added the type/bug label Feb 9, 2026
Signed-off-by: yeya24 <[email protected]>
Signed-off-by: yeya24 <[email protected]>
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size/L type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants