Skip to content

Multi-threshold alerts don't route to per-threshold notification channelsΒ #10592

@mango766

Description

@mango766

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions