@Karthike Ezhilarasan

Here's a basic template that I'm currently using - I forget which other 
thread I originally got it from - 

  slack_configs:
    channel: '#XXXXXXXXXXX'
    # templating documentation at:  
    # https:\\golang.org/pkg/text/template  
    color: '{{ if eq .Status "firing" }}{{ if eq .CommonLabels.severity 
"critical" }}danger{{ else if eq .CommonLabels.severity "warning" 
}}warning{{ else }}#439FE0{{ end }}{{ else}}good{{ end }}'
    send_resolved: true
    title: '{{ .CommonLabels.severity }} - {{ .CommonAnnotations.summary }}'
    text: |-
      <!here> - {{ .CommonAnnotations.description }}
      *Details:*
      {{ range .CommonLabels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
      {{ end }}
    actions:
    - type: button
      text: 'Runbook :notebook:'
      url: 'https://XXXXXXXXXXX/runbooks/lob-{{ .GroupLabels.lob 
}}/product-{{ .GroupLabels.service }}/{{ .GroupLabels.alertname }}'
    - type: button
      text: 'Dashboard :chart_with_upwards_trend:'
      url: 'XXXXXXXXXXX'



I haven't moved it all off into a template yet, because I'm still fiddling 
with it from time to time...


Hope that helps :)


Dan


-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/8aab4792-b145-49df-9c57-d8564286e735%40googlegroups.com.

Reply via email to