diff --git a/main.go b/main.go index c16ca88..321b5f5 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "github.com/prometheus/alertmanager/template" + "github.com/prometheus/common/model" "log" "net/http" "os" @@ -30,6 +31,11 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) { for _, alert := range payload.Alerts { + // Skip resolved messages + if alert.Status == string(model.AlertResolved) { + continue + } + log.Println(alert) req, err := http.NewRequest("POST", os.Getenv("NTFY_TOPIC"), strings.NewReader(alert.Annotations["description"]))