alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

feat: add googlechat notifier

Open tamcore opened this issue 2 years ago • 12 comments

This will add a Google Chat notifier and allow existing setups to replace the slightly aged calert with a native integration.

Essentially all that's required is to send a POST with {"text": "our alert"}, so there isn't too much breakage potential :D

  • [X] it actually works
  • [X] documentation
  • [X] tests (sorta)

#2940 2940

tamcore avatar Oct 11 '23 05:10 tamcore

Nice! Thanks @tamcore - Do you have any stats on downloads/usage over the past 6 months? I can see that it has a decent number of stars but would love to know more about the usage itself.

gotjosh avatar Oct 12 '23 15:10 gotjosh

Not really. But according to https://github.com/mr-karan/calert/pkgs/container/calert/64363789?tag=v2.0.6 the latest release had 39353 downloads during the 9 months since release.

But there's definitely some interest, and at our company we use it as well (but only one of those 39353 pulls is from us - we use an image cache :D)

  • https://2021.openinfra.id/slides/Didiet_A.Pambudiono-_Sending_Prometheus_Alertmanager_to_Google_Chat.pdf
  • https://stackoverflow.com/questions/66333868/send-notification-from-prometheus-alertmanager-to-google-chat-room
  • https://groups.google.com/g/prometheus-users/c/p8-O9m7ajqI

tamcore avatar Oct 12 '23 16:10 tamcore

@simonpasquier / @gotjosh any chance to get this included? :)

tamcore avatar Nov 02 '23 12:11 tamcore

I would like to see this included. Running external service for simple notifications is a pain in the back. This change doesn't look so dramatic, it should be merged relatively easily...

uded avatar Nov 13 '23 21:11 uded

It shows the error: ts=2024-01-18T12:57:51.801Z caller=coordinator.go:126 level=info component=configuration msg="Completed loading of configuration file" file=/etc/alertmanager/config.yml ts=2024-01-18T12:57:51.806Z caller=cluster.go:692 level=info component=cluster msg="gossip not settled but continuing anyway" polls=0 elapsed=69.811041ms panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe28cf1] goroutine 1 [running]: github.com/prometheus/alertmanager/notify/googlechat.New(0xc00099a3c0, 0xc0005df398, {0x1612340?, 0xc00020f5e0}, {0x0?, 0x0?, 0x0?}) /root/shivam/alertmanager/notify/googlechat/googlechat.go:44 +0x51 github.com/prometheus/alertmanager/config/receiver.BuildReceiverIntegrations.func15({0x1612340?, 0xc00020f5e0?}) /root/shivam/alertmanager/config/receiver/receiver.go:97 +0x3c github.com/prometheus/alertmanager/config/receiver.BuildReceiverIntegrations.func1({0x10cf6f5, 0xa}, 0x0, {0x1612900, 0xc00099a3c0}, 0xc000c44958) /root/shivam/alertmanager/config/receiver/receiver.go:48 +0xe6 github.com/prometheus/alertmanager/config/receiver.BuildReceiverIntegrations({{0xc000b67de0, 0xa}, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...) /root/shivam/alertmanager/config/receiver/receiver.go:97 +0x1030 main.run.func9(0xc000000aa0) /root/shivam/alertmanager/cmd/alertmanager/main.go:393 +0x5af github.com/prometheus/alertmanager/config.(*Coordinator).notifySubscribers(...) /root/shivam/alertmanager/config/coordinator.go:87 github.com/prometheus/alertmanager/config.(*Coordinator).Reload(0xc00057f500) /root/shivam/alertmanager/config/coordinator.go:131 +0x5b6 main.run() /root/shivam/alertmanager/cmd/alertmanager/main.go:481 +0x5605 main.main() /root/shivam/alertmanager/cmd/alertmanager/main.go:125 +0x13

shivam199064 avatar Jan 18 '24 13:01 shivam199064

Hey folks 👋 also interested in this feature 😊

mehdicopter avatar Apr 22 '24 16:04 mehdicopter

It looks like something similar to this MSTeams code needs to be added in config/config.go:

https://github.com/prometheus/alertmanager/blob/main/config/config.go#L535-L542

nathanlcarlson avatar May 09 '24 17:05 nathanlcarlson