fix after upstream change prometheus (refactoring of notify on alertmanager)

This commit is contained in:
Martin/Geno 2019-06-20 07:51:12 +02:00
parent 61a1532d6e
commit 1b5dceac86
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import (
libHTTP "dev.sum7.eu/genofire/golang-lib/http" libHTTP "dev.sum7.eu/genofire/golang-lib/http"
"github.com/bdlm/log" "github.com/bdlm/log"
xmpp "github.com/mattn/go-xmpp" xmpp "github.com/mattn/go-xmpp"
"github.com/prometheus/alertmanager/notify" "github.com/prometheus/alertmanager/notify/webhook"
"dev.sum7.eu/genofire/hook2xmpp/runtime" "dev.sum7.eu/genofire/hook2xmpp/runtime"
) )
@ -22,7 +22,7 @@ func init() {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
logger := log.WithField("type", hookType) logger := log.WithField("type", hookType)
var request notify.WebhookMessage var request webhook.Message
if err := libHTTP.Read(r, &request); err != nil { if err := libHTTP.Read(r, &request); err != nil {
logger.Errorf("no readable payload: %s", err) logger.Errorf("no readable payload: %s", err)
http.Error(w, fmt.Sprintf("no readable payload"), http.StatusInternalServerError) http.Error(w, fmt.Sprintf("no readable payload"), http.StatusInternalServerError)