-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Hey there! I was looking into the alert routing logic and noticed a potential issue with multi-threshold alerts.
Problem:
When creating an alert rule with multiple thresholds, each threshold can have its own channels (notification channels). However, the GetMatchers() function in sqlalertmanagerstore/config.go only looks at the top-level preferredChannels field to build alertmanager routes.
If a user sets channels at the threshold level but doesn't explicitly set preferredChannels at the rule level, those threshold-specific channels are silently ignored β alerts fire but never reach the intended channels.
Root cause:
processRuleDefaults() in api_params.go doesn't sync threshold-level channels up to the rule-level preferredChannels field.
Expected behavior:
When preferredChannels is empty but thresholds have their own channels configured, those channels should be collected and set as preferredChannels so alertmanager routing picks them up.
Happy to submit a fix if this looks right!