fix after upstream change prometheus (refactoring of notify on alertmanager)
This commit is contained in:
parent
61a1532d6e
commit
1b5dceac86
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue