-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Feature request: slack_configs.send_resolved a templatable field #4033
Comments
I think, at least for me, it is hard to understand what the use case is for this feature. Making notification decisions based on individual alerts also doesn't fit well in the Alertmanager design, which is based around grouping related alerts together. It would also be very easy for someone to write an invalid template and accidentally break all their notifications without realizing it. |
We have a centralised alertmanager with a configuration containing routes and receivers for a dozen or more teams, with hundreds of different alerts flowing to different channels. Some alerts teams will want send_resolved notifications, other alerts won't. The only way to do this currently is to have two routes and two receivers, one with a It would massively simplify (half!) our receivers configuration if we could inherit send_resolved (and other route level attributes like group_by) from the alert labels. |
Isn't this just "moving" the messiness from Alertmanager to Prometheus? Instead of a receiver per team, all alert rules must have a custom label |
It would be an optional label with That complexity per alert makes way more sense to me than it does at a receiver level; a lot of alerts just generate noise with resolved notifications, but some are genuinely useful. |
Practical example of how we use dynamic configuration. Taking some generic kubernetes alert:
We want this
Being able to set the |
I still think there are a lot of disadvantages here, and not a lot of advantages. For example:
Are you sure this couldn't be solved a better way, for example, by provisioning your Alertmanager configuration file using automation or CI? |
I'm open to suggestions. What would you recommend for controlling which alerts are resolved and which aren't? |
If I understand the problem, you are concerned with having a large number of routes and receivers for the teams in your organization, and find it difficult to manage them all due to their total size. My suggestion would be to provision your Alertmanager configuration automatically, then you don't need to edit it. For example, each team could specify their own route and receiver configurations, and then you can merge them together into a single Alertmanager configuration file using a script or automated job. You can avoid conflicts by suffixing the team name to each receiver like If you just want individual teams to choose between |
It isn't as black and white as teams will or won't want resolved notifications, though. It is still very much context specific to each alert as to whether a resolved notification is required. Even with automation and generating routes / receivers, it doesn't change the initial problem. |
I can see you are thinking about it in terms of individual alerts, but Alertmanager is very much a tool for grouping alerts. Can you can rephrase your problem in terms of groups? How should a |
I have the same use case as dwilliams. Based on the nature of the alert, some of my alerts don't want send_resolved to be set, these alerts are probably part of a group of alerts that do need send_resolved to be set. It's not like "all alerts from this service, or to this team don't need send_resolved".. It's more like "Log alerts for any service written in this way don't need send resolved". In fact, I feel like this goes against the design goal of thinking of things in terms of groups of alerts, because, I'm forced to ungroup from business logic lines and group them among technical implementation lines. |
The feature request (as described) doesn't support enabling/disabling |
What did you do?
I'm trying to set up a receiver that can take a dynamic value for
send_resolved
, such as:With this, we get a
line 894: cannot unmarshal !!map into bool
as Alertmanager requires this field to be boolean instead of a tmpl_string. There are various approaches to how this could be done so I'm not worried about this particular template working or not, but thesend_resolved
field does not allow templating as-is.What did you expect to see?
I would like to be able to render true/false boolean based on a label in an alert. This would reduce the number of receivers required.
The text was updated successfully, but these errors were encountered: