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
Alertmanager relabel config not being honoured #3239
Comments
Currently the `relabel_configs` under each `alertmanager_config` are not honoured - see prometheus#3239. I have made it so we run a relabel process for each of the alertmanager sets. So the relabeling doesn't change the alerts for other am sets I have had to create a new func called `amsRelabelAlerts` which updates a copy of the alert and not the alert itself. This does duplicate code a little, so there may be a better way to do this, suggestions welcome.
The relabel configs at this level are part of service discovery to select the alertmanager, not to change the alerts themselves. So this is the expected behaviour. |
This suggests that I should be able to select which alert manager gets which alert(s), which is what I am trying to do, but isn't working as expected. Am I misunderstanding your point? |
No, they're to select the alertmanagers that all alerts are sent to. Consider that if you were on kubernetes that the SD would return many many different pods, these relabel_configs let you limit that down just to those running the alertmanager. |
Ah I see what you mean. Thanks |
Is there any other way to have only certain alertmanagers receive only certain alerts? |
No, that's not possible currently. What's you use case? |
I plan to have one alertmanager for standard monitoring, and one for auto-remediation. The auto-remediation alertmanager will be locked down and part of a secure pipeline. I plan to have the auto-remediation alerts contain an auth token which I do not want sent to the standard monitoring alertmanager. |
I'm not seeing how that works, labels are not secret. I also don't understand why you need a 2nd alertmanager for that. |
I need to add authentication to the auto-remediation alertmanager as I do not want anyone to be able to send alerts to it, which could cause an automatic action. I would prefer not to send alerts to both if they are not needed on both alertmanagers. |
Things are built with the assumption that the alertmanagers are homogeneous, I think you might be over-complicating things for yourself a bit. |
Shame |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What did you do?
I have two alertmanagers set in my config, and I am trying to send only certain alerts to each:
What did you expect to see?
I would expect to alerts with the label {secure="yes"} to be dropped for target localhost:9093.
What did you see instead? Under which circumstances?
All alerts, including ones with {secure="yes"}, were sent to both alertmanagers.
If I set the relabel config under
alert_relabel_configs
all alerts with {secure="yes"} are dropped, but the docs suggest that I should be able to set differentrelabel_configs
for each alertmanager.Here is the config when dropping {secure="yes"} for both alertmanagers:
Environment
Alerts file:
The text was updated successfully, but these errors were encountered: