Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus active alerts - block reboot if regexp matches #775

Closed
jimliming opened this issue Jun 5, 2023 · 2 comments
Closed

prometheus active alerts - block reboot if regexp matches #775

jimliming opened this issue Jun 5, 2023 · 2 comments
Milestone

Comments

@jimliming
Copy link
Contributor

jimliming commented Jun 5, 2023

Currently --alert-filter-regexp will filter out items from a list of active alerts in Prometheus. If anything is left, a reboot will be blocked.

I'm hoping to match on very specific alerts and block reboots on those. so, we take the entire list and if "(A|B|C|D)" exists, then block reboots.

I spent some time trying to write something to inverse this, but without the ability to use lookahead/lookbehind (this isnt supported in https://github.com/google/re2/wiki/Syntax) I couldnt get anything to work out.

Let me know if this is interesting/on a list somewhere. I could take a stab at a PR if there's interest.

edit: Could even be as simple as we add a parameter to control if alert-filter-regexp is an inverse match or not. (default being current behavior of inverse)

@ckotzbauer
Copy link
Member

Hi @jimliming,
thanks for opening this issue. Yeah, I think it would make sense to add a parameter which would invert the logic the regex-result is processed. Would you mind opening a PR?

@jimliming
Copy link
Contributor Author

You bet, opened in: #786

@ckotzbauer ckotzbauer added this to the 1.14.0 milestone Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants