Skip to content

option to resolve alerts that fired inhibited - #3034

Open
edevil wants to merge 1 commit into
prometheus:mainfrom
edevil:resolve_inhibited
Open

edevil wants to merge 1 commit into
prometheus:mainfrom
edevil:resolve_inhibited

Conversation

@edevil

@edevil edevil commented Aug 2, 2022

Copy link
Copy Markdown

Added new option to let resolve notifications flow from inhibited
alerts, if they fired unmuted.

Attempts to address #226

@rdegez

rdegez commented Nov 30, 2023

Copy link
Copy Markdown

We are in the same situation (like many other people I guess!) and desperately need this PR to be merged or a way to resolve inhibited alerts :-)

@RyanW8

RyanW8 commented Jan 24, 2024

Copy link
Copy Markdown

Any movement on this? A feature we desperately need!

Added new option to let resolve notifications flow from inhibited
alerts, if they fired unmuted.

Signed-off-by: André Cruz <acruz@cloudflare.com>
@edevil
edevil force-pushed the resolve_inhibited branch from 2ccf81a to cfd55c2 Compare January 25, 2024 17:56
@cxdy

cxdy commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

Adding onto this, would really really love to see this get merged into a release. Real bummer this has been stale for so long, this would be a huge feature for my org.

@edevil If you aren't interested in cleaning up the merge conflicts here, I'm happy to take a stab at this.

@edevil

edevil commented Sep 25, 2024

Copy link
Copy Markdown
Author

@edevil If you aren't interested in cleaning up the merge conflicts here, I'm happy to take a stab at this.

At this point I have resolved conflicts several times. I would like some signal from the maintainer that there is a path forward otherwise it is time wasted.

@cxdy

cxdy commented Sep 25, 2024 •

Copy link
Copy Markdown
Contributor

I reached out in the #prometheus-alertmanager channel on the CNCF Slack asking for some maintainer eyes.

@cxdy cxdy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally with the opsgenie receiver and i got a resolution notification

not a maintainer so my review is meaningless but this is awesome, thank you!

@cxdy

cxdy commented Oct 10, 2024

Copy link
Copy Markdown
Contributor

@gotjosh sorry to bug ya but any chance we can push this forward?

@gitirabassi

Copy link
Copy Markdown

@gotjosh could you please give your opinion as this is crucial for me too (as many others) and I'd like to understand what is your take on this. if it's just an issue with risky change, specific implementation or principles

I'd just like to understand if I should create my own fork too with this PR merged or could contribute somehow to this being merged.

Thank you for your continuous work

@gitirabassi

Copy link
Copy Markdown

@bwplotka maybe your opinion would also be great

@anarcat

anarcat commented Dec 17, 2024

Copy link
Copy Markdown
Contributor

I reached out in the #prometheus-alertmanager channel on the CNCF Slack asking for some maintainer eyes.

was there a response on this?

i don't understand what's blocking this PR from being merged. in #226 (comment), @brian-brazil seemed to object to having a configuration option for this in the first place, and there were lots of different ideas in that thread...

i'm just not sure exactly what the way forward is, but i do know that it's pretty confusing that inhibited/silenced alerts don't show resolution, as the recipient of those notifications.

Comment thread notify/notify.go
Comment on lines +530 to +540
isMuted := n.muter.Mutes(a.Labels)
if !isMuted && !a.Resolved() && n.resolveInhibited {
a.FiredUnmuted = true
}
// Do not send the alert if muted.
if n.muter.Mutes(a.Labels) {
muted = append(muted, a)
} else {
// Do send resolved notifications if configured
// to do so and the alert fired unmuted.
if !isMuted || (a.Resolved() && a.FiredUnmuted && n.resolveInhibited) {
filtered = append(filtered, a)
} else {
muted = append(muted, a)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually find this hunk a little confusing. why are we flipping a.FiredUnmuted here? the conditional looks *really* similar to the second one there, and, what's worse, the a.FireUnmuted` is reused there which, effectively, makes the second conditional look like:

!isMuted || (a.Resolved() && (!isMuted && !a.Resolved() && n.resolveInhibited) && n.resolveInhibited) 

which i think is equivalent to:

!isMuted || (!a.FiredUnmuted && a.Resolved() && && n.resolveInhibited) 

before a.FiredUnmuted is reset. i wonder if there's a way to make this code more readable, perhaps with a comment explaing why the FiredUnmuted flag is changed there?

@cxdy

cxdy commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

@anarcat

was there a response on this?

unfortunately it's been crickets. not sure what the best path forward here is :/

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.

6 participants