8000 fix: validate route matchers by rexagod · Pull Request #7864 · prometheus-operator/prometheus-operator · GitHub
[go: up one dir, main page]

Skip to content

Conversation

rexagod
Copy link
Contributor
@rexagod rexagod commented Sep 2, 2025

Description

Validate route matchers for AlertmanagerConfigurations, so they don't crash the main instance.

Resumes: #6007
Fixes: #5163

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.)

Validate route matchers for AlertmanagerConfigurations, so they don't
crash the main instance.

Fixes: prometheus-operator#5163

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
@simonpasquier
Copy link
Contributor

Thanks! Can we just check the format of matcher.Name? E.g. it should match [a-zA-Z_:][a-zA-Z0-9_:]* (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).

@simonpasquier
Copy link
Contributor

I would also recommend an e2e test to avoid future regressions.

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.

Prometheus operator generated invalid Alertmanager configuration
2 participants
0