Hi folks,

I am trying to setup AlertManager to send notifications to both Slack and 
PagerDuty. With my current configuration, alerts only go to Slack.

Can someone kindly review my alertmanager.yml and let me know what I'm 
missing?

global:
  resolve_timeout: 1m
  slack_api_url: 'https://hooks.slack.com/services/XXXXXX/XXXXX/XXXXXXXX'
  pagerduty_url: 'https://events.pagerduty.com/v2/enqueue'
route:
  receiver: 'slack-notifications'
  routes:
    - match:
        severity: critical,warning
      receiver: 'slack-notifications'
      continue: true
    - match:
        severity: critical,warning
      receiver: 'pagerduty-notifications'
      continue: false
receivers:
  - name: 'slack-notifications'
    slack_configs:
    - channel: '#operation-alerts-test'
      send_resolved: true
      icon_url: https://avatars3.githubusercontent.com/u/3380462
      title: |-
        [{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ 
.Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} for {{ 
.CommonLabels.job }}
        {{- if gt (len .CommonLabels) (len .GroupLabels) -}}
          {{" "}}(
          {{- with .CommonLabels.Remove .GroupLabels.Names }}
            {{- range $index, $label := .SortedPairs -}}
              {{ if $index }}, {{ end }}
              {{- $label.Name }}="{{ $label.Value -}}"
            {{- end }}
          {{- end -}}
          )
        {{- end }}
      text: >-
        {{ range .Alerts -}}
        *Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ 
.Labels.severity }}`{{ end }}

        *Description:* {{ .Annotations.description }}

        *Details:*
          {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
          {{ end }}
        {{ end }}
  - name: 'pagerduty-notifications'
    pagerduty_configs:
    - service_key: xxxxxxx
      send_resolved: true

Thank you and Happy Holidays

-- 
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/29354080-55e2-4815-ab85-c7c71e5621b9n%40googlegroups.com.

Reply via email to