Skip to content

Support routing notification policies by alert state (firing vs resolved) #624

Description

@omar-cornejo

Hi everyone,

I would like to ask whether there is already a proposal or PR for routing notification policies based on alert state.

Right now, notification policies seem to route alerts only by labels. In my case, I would really like to route the same alert differently depending on whether it is firing or resolved.

Why this would help:
Because of this limitation, I currently have to handle part of the logic outside Grafana when alerts are sent to n8n through a contact point. I also run into situations where I want some alerts to go to IRM, and that ends up forcing me to maintain two separate flows, one in IRM and another in Grafana. Sometimes that creates cases I do not want, so being able to decide the route inside Grafana based on alert state would make the setup much cleaner.

A rough idea of how I imagine it could work:

if alert.state == firing:
route to receiver_a
else if alert.state == resolved:
route to receiver_b

Or in a policy style:

route:
matchers:
- alert_state = firing
contact-point: n8n-firing

route:
matchers:
- alert_state = resolved
contact-point: irm

If something like this already exists, I would appreciate a pointer to it. If not, I would love to know whether this would be a reasonable feature to consider.

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