Skip to content

feat: Add configuration to skip label sanitization#4796

Merged
jake-kramer merged 3 commits into
mainfrom
remove-label-sanitization
Feb 4, 2026
Merged

feat: Add configuration to skip label sanitization#4796
jake-kramer merged 3 commits into
mainfrom
remove-label-sanitization

Conversation

@jake-kramer
Copy link
Copy Markdown
Contributor

@jake-kramer jake-kramer commented Jan 28, 2026

Label sanitization would convert labels with dots to underscores. This change updates the validation logic to accept any utf-8 valid label name. The read path has been previously updated to filter out all non-legacy label names (ascii with underscores) unless the allow-utf8-labelnames client capability is set.

By default, there is no change in logic/behavior

If disable_label_sanitization is set to true, these are the breaking changes:

  • Labels with dots will no longer be sanitized in to underscores.
  • Any labels written that do not match the regex ^[a-zA-Z_][a-zA-Z0-9_]*$ will be written as-is
  • Any labels written that do not match the regex ^[a-zA-Z_][a-zA-Z0-9_]*$ will be filtered out of the read path unless the allow-utf8-labelnames client capability is set.

Consider using IngestionRelabelRules for label sanitization moving forward.

@jake-kramer jake-kramer force-pushed the remove-label-sanitization branch 2 times, most recently from dbde2ee to 605c835 Compare January 28, 2026 15:53
Label sanitization would convert labels with dots to underscores. This change
updates the validation logic to accept any utf-8 valid label name. The read
path has been [previously](#4442) updated
to filter out all non-legacy label names (ascii with underscores) unless the
`allow-utf8-labelnames` client capability is set.

This is a breaking change:
- Labels with dots will no longer be sanitized in to underscores.
- Any labels written that do not match the regex `^[a-zA-Z_][a-zA-Z0-9_]*$` will be written
as-is
- Any labels written that do not match the regex `^[a-zA-Z_][a-zA-Z0-9_]*$` will be filtered
out of the read path unless the `allow-utf8-labelnames` client capability is set.

Consider using `IngestionRelabelRules` for label sanitization moving forward.
@jake-kramer jake-kramer force-pushed the remove-label-sanitization branch from 605c835 to 2671ca3 Compare January 28, 2026 16:12
@jake-kramer jake-kramer marked this pull request as ready for review January 28, 2026 16:34
@jake-kramer
Copy link
Copy Markdown
Contributor Author

Won't be merged until relabeling rules are all set on the cloud side

Copy link
Copy Markdown
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

Not too sure what others are thinking, but I fear this feels like a proper breaking change to our OSS users and therefore, I think we should not do it between releases, and bundle the change into a Pyroscope v2.

For now I would introduce a flag or even better a per tenant override controlling this change and once we are working on we can do the breaking change and provide instructions, how to get the old behaviour back via relabeling rules.

Wdyt?

@jake-kramer jake-kramer requested review from a team and alsoba13 as code owners February 3, 2026 19:21
@jake-kramer
Copy link
Copy Markdown
Contributor Author

Not too sure what others are thinking, but I fear this feels like a proper breaking change to our OSS users and therefore, I think we should not do it between releases, and bundle the change into a Pyroscope v2.

For now I would introduce a flag or even better a per tenant override controlling this change and once we are working on we can do the breaking change and provide instructions, how to get the old behaviour back via relabeling rules.

Wdyt?

Addressed in af4f74d.

@jake-kramer jake-kramer changed the title feat: Remove label sanitization feat: Add configuration to skip label sanitization Feb 3, 2026
Copy link
Copy Markdown
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding this configuration toggle.

Give it a quick spin works as expected:

With validation disabled: the builtin ui handles emoji correctly

image

A grafana + drilldown is filtering it:

image

@jake-kramer jake-kramer merged commit a687867 into main Feb 4, 2026
22 checks passed
@jake-kramer jake-kramer deleted the remove-label-sanitization branch February 4, 2026 14:13
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