Table of Contents

,

Grafana to rocketchat notifications

First set create the Contact point under Alerting and add Rocketchat webhook.

Under Optional webhook settings set:

> HTTP method to post

> Extra headers to Content-Type application/json

then set the Custom payload (click on Edit Payload template > Enter custom payload template) to something RC expects e.g.

| download
{
  "emoji":":panda_face:",
  "alias": "Grafana alert",
  "text": "{{ range .Alerts }}*{{ .Status | toUpper }}*: {{ .Labels.compose_project }}\n Server host: {{ .Labels.host }}\nContainer name: {{ .Labels.container_name }}\n{{ end }}",
  "attachments": [
    {
      "title": "Link to below dashboard",
      "title_link": "{{ range .Alerts }}{{ .DashboardURL }}{{ end }}",
      "text": "Rocket.Chat, the best open source chat",
      "image_url": "https://rocket.chat",
      "color": "#724AA5"
    }
  ]
}

.Labels contains the labels assigned under the Alert rules. Change other fields as well.

Tested on

See also

References