Skip to content

feat: Add hasLabelsForEveryAggregation validator - #109

Open
pw-mdb wants to merge 1 commit into
FUSAKLA:masterfrom
pw-mdb:push-xtupmvrlwuxr
Open

feat: Add hasLabelsForEveryAggregation validator#109
pw-mdb wants to merge 1 commit into
FUSAKLA:masterfrom
pw-mdb:push-xtupmvrlwuxr

Conversation

@pw-mdb

@pw-mdb pw-mdb commented Feb 26, 2025

Copy link
Copy Markdown

This adds a hasLabelsForEveryAggregation validator, which verifies that every aggregation in an alert expression has a set of labels. The new validator has a excludeRuleLabels option, which ignores labels in labels if they are specified in the alert rule's labels.

This is useful for partially ensuring that alert rules return labels that are required for AlertmanagerConfig matchers. For example, when using prometheus-operator, the operator adds an implicit namespace matcher to every AlertmanagerConfig. Alert rules that don't return the namespace label get silently blackhole'd. Because of this, aggregations are a huge source of blackhole'd alerts for us.

@FUSAKLA

FUSAKLA commented Feb 28, 2025

Copy link
Copy Markdown
Owner

Hi! Thanks for the contribution 🎉

The validation idea makes sense, so I'd be happy to add it 👍

Could you please:

@FUSAKLA FUSAKLA self-assigned this Feb 28, 2025
@FUSAKLA
FUSAKLA self-requested a review February 28, 2025 14:44
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