metalmatze / alertmanager-bot

[deprecated] Bot for Prometheus' Alertmanager
MIT License
657 stars 148 forks source link

Support Mattermost via webhooks #25

Open metalmatze opened 6 years ago

metalmatze commented 6 years ago

Following the discussion going on at https://github.com/prometheus/alertmanager/issues/1512. We should try to support Mattermost next to Telegram.

We can first start by supporting message delivering to Mattermost. Afterwards we can look into supporting mattermost commands for the bot.

cc @cpanato @mxinden

cpanato commented 6 years ago

@metalmatze we have a new plugin system, which you can do much more, maybe we can create a Prometheus plugin for mm. I will spend some time here to se how it works and see where I can contribute :) thanks!!

metalmatze commented 6 years ago

Any updates on this topic?

cpanato commented 6 years ago

@metalmatze sorry no

But I was thinking to write the bot using the Mattermost plugin system, but will be another binary and all other configs, not sure if we can keep here or create a new repo for that

cpanato commented 6 years ago

I will add this in my objectives to get this done :)

metalmatze commented 6 years ago

Do you have any links for the plugin system? I can also take a look.

cpanato commented 6 years ago

@metalmatze here is https://developers.mattermost.com/extend/getting-started/

cpanato commented 5 years ago

I was thinking to fork your project and rewrite the bot using the plugin mattermost plugin

cpanato commented 5 years ago

the webhook notification is working

Screenshot 2019-03-24 at 21 50 04

I will use the same approach you did and will use your pkg/alertmanager for the functions, but i'm implemting this as a mattermost plugin 😄

metalmatze commented 5 years ago

I'm happy to have it in this repository, if you want. I don't see any particular reason not too, is there? If you want I can make you a maintainer.

cpanato commented 5 years ago

I did this repo, since the plugin have some specific things :) i used your client and update that to use the v2 of the alertmanager :)

https://github.com/cpanato/mattermost-plugin-alertmanager

if you want i can convert your project to use the v2 as well

metalmatze commented 5 years ago

Hmm, I'd be fine with having it in here. The Telegram package in pkg/telegram should be standalone as well and doesn't rely on any other package. The same applies to a package for Hangouts Chat that @mulbc wants to contribute.

The only dependencies for those packages are the chan notify.WebhookMessage and store.

https://github.com/metalmatze/alertmanager-bot/blob/989c04be0587634a4d0432f5070115e868f817ab/cmd/alertmanager-bot/main.go#L190

https://github.com/metalmatze/alertmanager-bot/blob/989c04be0587634a4d0432f5070115e868f817ab/cmd/alertmanager-bot/main.go#L165

Everything else needs to be implemented by the package itself with total control/freedom/responsibilities. :wink:

There's already a PR pending with a generated API v2 client https://github.com/metalmatze/alertmanager-bot/pull/47.

jdbarnes-isi commented 4 years ago

We have a prometheus/alertmanager running inside a walled garden, but outside of our k8s cluster and a cloud hosted mattermost server. would your mattermost integrations work to send alerts for that?

metalmatze commented 4 years ago

Right now my bot still doesn't support Mattermost. Although I started with the overhaul and simply don't have the time for this project to make a full rewrite on my own.

metalmatze commented 4 years ago

Thus, I still recommend using the one my friend @cpanato has built! :)