alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

Allow webex roomID from template

Open bakito opened this issue 1 year ago • 6 comments

I my environment I'd like to be able to define different webex roomIDs for different namespaces. This PR adds the possibility to use templates in the webex roomID field, which allow to get the roomID from GroupVariables.

bakito avatar Apr 10 '24 09:04 bakito

I took a look at some of the other integrations supported in Alertmanager (Discord, Slack, Microsoft Teams, Telegram, VictorOps) and it seems like templates are not supported for the channel/room. I think the general advice is to have a separate receiver for each Room ID, and then route to the correct receiver using label matchers. What do you think @gotjosh?

grobinson-grafana avatar Apr 10 '24 09:04 grobinson-grafana

Just because they do not (yet) support it, should that mean other should not? Email also supports the to field from templates.

bakito avatar Apr 10 '24 10:04 bakito

Just to help us understand the use case better, how many Room IDs are you planning to use with your template? Is it a large enough number that creating separate integrations would be a maintenance headache?

grobinson-grafana avatar Apr 10 '24 10:04 grobinson-grafana

We have a setup of prometheus and alertmanager using the kube-prometheus-stack. We have several Team wit n namespaces, where each team has n namespaces. Each Team has 1 - n Rooms for their notifications.

The main issue with webex is not the roomID, but the Token used for the Bot to authenticate.

Teams could create their own AlertmanagerConfig custom resource in each namespace. But then they would always need to know the Bot's auth token for this config.

Managing all this recievers on the default config is not dynamic enough as teams can dynamically create and destroy namespaces via self service.

If the roomId could be fetched from GroupVariables provided by Prometheus Rules (Each namespace has already their own set of rules), one central receiver config could be used and teams would not have to bother about the auth token.

We would like to use the same Webex Bot for all notifications, but the token should not be spread over several namespaces.

bakito avatar Apr 10 '24 10:04 bakito

Teams could create their own AlertmanagerConfig custom resource in each namespace. But then they would always need to know the Bot's auth token for this config.

Would credentials_file work for that use case? You would mount a volume with the credentials file in it.

grobinson-grafana avatar Apr 12 '24 08:04 grobinson-grafana

Would credentials_file work for that use case? You would mount a volume with the credentials file in it.

Mabe with the token, but not with the main issue I'm trying to address here. Which is the boilerplate configuration of n notifiers where only the roomId changes.

bakito avatar Apr 12 '24 09:04 bakito

@grobinson-grafana Is this going to be merged soon?

bakito avatar May 29 '24 05:05 bakito

Hi! 👋 I don't have merge permissions, but I'll ping one of the maintainers.

grobinson-grafana avatar May 29 '24 07:05 grobinson-grafana