diff --git a/pkg/gateway/gateway.go b/pkg/gateway/gateway.go index 08c551c..0b4d602 100644 --- a/pkg/gateway/gateway.go +++ b/pkg/gateway/gateway.go @@ -142,10 +142,14 @@ func (g *Gateway) HandleHTTP() (string, http.HandlerFunc) { h := func(w http.ResponseWriter, r *http.Request) { r = r.WithContext(SetSecret(r.Context(), g.secret)) if msg, err := g.source.ParseHTTP(r); err != nil || len(msg) == 0 { - http.Error(w, fmt.Sprintf("failed processing incoming request: %s", err), http.StatusBadRequest) + msg := fmt.Sprintf("failed processing incoming request: %s", err) + http.Error(w, msg, http.StatusBadRequest) + g.logger.Debug(msg) return } else if err = g.destination.PushMessages(r.Context(), msg...); err != nil { - http.Error(w, fmt.Sprintf("failed pushing notification messages: %s", err), http.StatusBadRequest) + msg := fmt.Sprintf("failed pushing notification messages: %s", err) + http.Error(w, msg, http.StatusBadRequest) + g.logger.Debug(msg) return } } diff --git a/pkg/source/grafana/grafana.go b/pkg/source/grafana/grafana.go index 3c5808c..74528f8 100644 --- a/pkg/source/grafana/grafana.go +++ b/pkg/source/grafana/grafana.go @@ -40,7 +40,8 @@ type Alert struct { Status string `json:"status"` Labels map[string]string `json:"labels"` Annotations map[string]string `json:"annotations"` - Values map[string]string `json:"valueString"` + Values map[string]string `json:"values"` + ValueString string `json:"valueString"` StartsAt string `json:"startsAt"` EndsAt string `json:"endsAt"`