Grafana Alert in Slack

@grafana-labs-team @grafanalabs @georgerobinson I would like to customize alerts in grafana to Slack, I came accross an issue when trying to sent just the link with the dashboard and panel url, it does not work

Firing

  • Alertname: {{ .CommonLabels.alertname }}
  • Environment: {{ .CommonLabels.env }}
  • Description: {{ .CommonAnnotations.description }}
    // everything above works fine
    //everything below does not work at all, it just does not show anything
  • Panel: {{ .PanelURL }}
    Go to Dashboard: [{{ .DashboardURL }}]({{ .DashboardURL }})]

Please check out the reference. There is no field called .PanelURL or .DashboardURL outside of an alert.

Thanks, I figured it out but thanks your answer is accurate right.

  • Alertname: {{ .CommonLabels.alertname }}
  • Environment: {{ .CommonLabels.env }}
  • Description: {{ .CommonAnnotations.description }}
  • Panel Dashboard: {{ range .Alerts }}
    {{ .PanelURL }}
    {{ end }}
1 Like