Skip to content

Fix error messages in label and exemplar validation - #1236

Open
caiotheodoro wants to merge 1 commit into
prometheus:masterfrom
caiotheodoro:fix-validation-error-messages
Open

caiotheodoro wants to merge 1 commit into
prometheus:masterfrom
caiotheodoro:fix-validation-error-messages

Conversation

@caiotheodoro

Copy link
Copy Markdown

_validate_exemplar raises Exemplar labels have %d UTF-8 characters, exceeding the limit of 128 without ever filling in the placeholder, so Counter('c', 'h').inc(exemplar={'a': 'x' * 129}) reports a literal %d. It now reports the count.

_validate_labelnames raises Reserved label methe fric name: le for Histogram(..., labelnames=['le']) and Summary(..., labelnames=['quantile']). The typo came in with #1070; before that it read Reserved label metric name. Restored.

The four affected tests now assert on the message and fail on the old source. Full suite: 428 passed, 14 skipped.

@csmarchbanks

Drafted with Claude Sonnet 5.5. Reviewed by Muse Spark 1.3 and GLM 5.3 as judges before submission.

The exemplar length error never interpolated its %d placeholder, and the reserved label error read "Reserved label methe fric name" since prometheus#1070.

Signed-off-by: Caio Theodoro <48462974+caiotheodoro@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant