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

When adding multiple Alertmanager configs in the plugin, messages are posted to a random channel #394

Open
aboukhal opened this issue Feb 9, 2024 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@aboukhal
Copy link

aboukhal commented Feb 9, 2024

We're using Mattermost 9.4.1 and plugin 0.4.0

Setup:
We have configured four different Alertmanagers in the cluster. They all use the same team, but different channels and they each have a unique token.

Incorrect behavior:
When alerts are sent by the cluster (or when sending test messages) to the four URLs, the messages are being posted into one of the four configured channels randomly. When sending the same message over and over, the channel seems to be consistent, even if it is wrong. If the message is changed ever so slightly, it lands in a different, random channel, even though the token was not touched.

Expected behavior:
The message should always be posted to the channel associated with the token.

What else have I tied:
I looked at the code to determine if there were debug logs, that could be enabled to figure out what goes wrong. This is not the case. I also reviewed the relevant code sections but nothing jumped out immediately. It looks plausible.

What did I not try:
I am unable to add additional debug logs or play with the code, as I'm not in an environment where I can easily build Go projects.

Do you have any idea what's going wrong?

@Pengwin61
Copy link

Pengwin61 commented Feb 20, 2024

Good afternoon. I also encountered similar behavior of the plugin. I don't have an alertmanager cluster, only 1 copy. I created 3 channels in one team. And I get something completely different

route:
  receiver: 'telegram_bot'
  group_by: ['alertname']
  group_wait: 5s
  group_interval: 1m
  repeat_interval: 12h
  routes:
  - match:
      alertgroup: 'SD'
    receiver: 'mm-home-sd'
  - match:
      alertgroup: 'InfraRules'
    receiver: 'mm-home-infra'
  - match:
      alertgroup: 'Hardware'
    receiver: 'mm-home-hardware'
mm_chat1 mm_chat mm

@cpanato cpanato added bug Something isn't working help wanted Extra attention is needed labels Feb 20, 2024
@cpanato
Copy link
Owner

cpanato commented Feb 20, 2024

thanks for the report, are you willing to open a PR to fix this issue?

@aboukhal
Copy link
Author

aboukhal commented Mar 4, 2024

We don't have the environment to build Go applications without a lot of effort. So dry-analyzing the source code was as much as I could do at the moment

@aboukhal
Copy link
Author

After figuring out that Mattermost supports most of the schema from Slack, we have now switched over to using the Slack configuration from Alertmanager. We've lost time calculations (using a timezone other than UTC or calculating durations, I've opened prometheus/alertmanager#3762 for that) but gained extensive customizability.
There are a lot of Slack template examples on the net to have a solid starting point for this.
Thanks for this Plugin, we would have loved to stick with it but in the current state we needed a solution that we can easily develop ourselves.

@baznikin
Copy link

Confirm, same problem.

@aboukhal are you using Slack's configuation for Alertmanager to send notification to MatterMost, am I right?

@aboukhal
Copy link
Author

@aboukhal are you using Slack's configuation for Alertmanager to send notification to MatterMost, am I right?

Correct. The tricky part is to create the templates so that messages look good in Mattermost with the appropriate formating, emojis, etc. But once that's done, it just works out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants