Skip to content

fix(config): validate label characters in Pyroscope config#298

Merged
korniltsev-grafanista merged 2 commits into
mainfrom
chore/validate-label-characters
Jul 3, 2026
Merged

fix(config): validate label characters in Pyroscope config#298
korniltsev-grafanista merged 2 commits into
mainfrom
chore/validate-label-characters

Conversation

@korniltsev-grafanista

Copy link
Copy Markdown
Contributor

Summary

  • Reject appName and tag keys/values that contain Prometheus label syntax characters ({, }, ,, =) during config validation
  • Keep existing tag type checks (string or number)

Test plan

  • Run yarn test
  • Verify invalid appName / tag values produce clear validation errors at init time

Reject appName and tag keys/values containing Prometheus label syntax
characters ({, }, ,, =) during config validation.
@korniltsev-grafanista korniltsev-grafanista requested review from a team as code owners June 30, 2026 04:56
@korniltsev-grafanista korniltsev-grafanista changed the title Validate label characters in Pyroscope config fix(config): validate label characters in Pyroscope config Jun 30, 2026
jake-kramer
jake-kramer previously approved these changes Jul 2, 2026

@jake-kramer jake-kramer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to get a test for this, even if it's just an end-to-end failure

Comment thread src/utils/check-pyroscope-config.ts Outdated

if (typeof tagValue === 'string' && hasInvalidLabelCharacters(tagValue)) {
errors.push(
`tag value for "${tagKey}" must not contain ${INVALID_LABEL_CHARACTERS_MESSAGE}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this message and one below would be helpful to log the tagValue too

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@korniltsev-grafanista korniltsev-grafanista merged commit 3667230 into main Jul 3, 2026
14 checks passed
@korniltsev-grafanista korniltsev-grafanista deleted the chore/validate-label-characters branch July 3, 2026 14:02
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.

2 participants