From 03904c00398da1bf1ac65d13116f94d315727881 Mon Sep 17 00:00:00 2001 From: Beast Date: Fri, 7 Aug 2026 16:46:31 +0800 Subject: [PATCH] feat: change to generic webhook --- .../contactpoints.rocket.fragment.yml | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/grafana/provisioning/alerting/contactpoints.rocket.fragment.yml b/grafana/provisioning/alerting/contactpoints.rocket.fragment.yml index 191da21..0ad9469 100644 --- a/grafana/provisioning/alerting/contactpoints.rocket.fragment.yml +++ b/grafana/provisioning/alerting/contactpoints.rocket.fragment.yml @@ -2,35 +2,33 @@ name: Rocket Notifications receivers: - uid: rocket-contact-point - type: slack + # Use webhook (not slack): Rocket returns {"success":true}, which Grafana's + # Slack notifier treats as failure and retries every group_interval. + type: webhook settings: url: ${ROCKET_WEBHOOK_URL} - username: Grafana Monitor - text: | + httpMethod: POST + title: | + {{ if eq .Status "firing" }}๐Ÿšจ{{ else }}โœ…{{ end }} {{ .CommonLabels.alertname }} โ€” {{ .Status | toUpper }} + message: | {{ range .Alerts -}} - ๐Ÿšจ *{{ .Labels.alertname }}* โ€” {{ .Status | toUpper }} - {{- if .Labels.severity }} - *Severity:* {{ .Labels.severity }} - {{- end }} - {{- if .Labels.chain }} - *Chain:* {{ .Labels.chain }} - {{- end }} - {{- if .Labels.instance }} - *Instance:* {{ .Labels.instance }} - {{- end }} + {{- if .Labels.severity }}*Severity:* {{ .Labels.severity }} + {{ end -}} + {{- if .Labels.chain }}*Chain:* {{ .Labels.chain }} + {{ end -}} + {{- if .Labels.instance }}*Instance:* {{ .Labels.instance }} + {{ end -}} {{- if .Annotations.summary }} - ๐Ÿ“‹ {{ .Annotations.summary }} - {{- end }} + {{ end -}} {{- if .Annotations.description }} {{ .Annotations.description }} - {{- end }} + {{ end -}} {{- if .GeneratorURL }} - ๐Ÿ”— [View in Grafana]({{ .GeneratorURL }}){{ if .SilenceURL }} ยท [Silence]({{ .SilenceURL }}){{ end }} {{- else if .SilenceURL }} - ๐Ÿ”— [Silence]({{ .SilenceURL }}) {{- end }} + {{ end -}} disableResolveMessage: false