Skip to content

feat: add label_name_underscore_sanitization and label_name_preserve_multiple_underscores to OTLPConfig #8562

Open
dongjiang1989 wants to merge 3 commits into
prometheus-operator:mainfrom
kubeservice-stack:update-otlpconfig
Open

feat: add label_name_underscore_sanitization and label_name_preserve_multiple_underscores to OTLPConfig #8562
dongjiang1989 wants to merge 3 commits into
prometheus-operator:mainfrom
kubeservice-stack:update-otlpconfig

Conversation

@dongjiang1989
Copy link
Copy Markdown
Member

@dongjiang1989 dongjiang1989 commented May 9, 2026

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

ref: prometheus/prometheus#17345

  • Add labelNameUnderscoreSanitization and labelNamePreserveMultipleUnderscores fields to the OTLPConfig type in the Prometheus CRD.
  • Both fields require Prometheus >= v3.8.0 and are only relevant when translation_strategy uses underscore escaping (UnderscoreEscapingWithSuffixes or
    UnderscoreEscapingWithoutSuffixes).
  • labelNameUnderscoreSanitization controls whether to prepend key_ to labels starting with _ (reserved labels starting with __ are not modified).
  • labelNamePreserveMultipleUnderscores enables preserving multiple consecutive underscores in label names during sanitization (defaults to true).

If you're contributing for the first-time, check our contribution guidelines.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

add `label_name_underscore_sanitization` and `label_name_preserve_multiple_underscores` to OTLPConfig

@dongjiang1989 dongjiang1989 requested a review from a team as a code owner May 9, 2026 04:04
…multiple_underscores to OTLPConfig

Signed-off-by: dongjiang <[email protected]>
Comment thread pkg/apis/monitoring/v1/prometheus_types.go
Comment thread pkg/apis/monitoring/v1/prometheus_types.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants