Skip to content

Commit

Permalink
Add slack alert for mirrors in alertmanager
Browse files Browse the repository at this point in the history
This configures alertmanager to send a slack message when the
MirrorFreshnessAlert is firing.
  • Loading branch information
theseanything committed Oct 27, 2023
1 parent 41d4f50 commit b9e2318
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ alertmanager:
group_interval: 12h
active_time_intervals:
- inhours
- match:
alertname: MirrorFreshnessAlert
receiver: 'slack-mirror-freshness'
repeat_interval: 1d
group_wait: 12h
group_interval: 12h
active_time_intervals:
- inhours
receivers:
- name: 'null'
- name: 'pagerduty'
Expand All @@ -46,6 +54,19 @@ alertmanager:
{{ range .Alerts -}}
• api_user: `{{ .Labels.api_user }}`, application: `{{ .Labels.application }}`
{{ end }}
- name: 'slack-mirror-freshness'
slack_configs:
- channel: '#govuk-platform-engineering'
send_resolved: true
icon_url: https://avatars3.githubusercontent.com/u/3380462
title: |-
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }}
text: >-
*Description:* {{ .CommonAnnotations.description }}

*Environment:* ${environment}

*Mirror*: {{ $labels.backend }}
time_intervals:
- name: inhours
time_intervals:
Expand Down

0 comments on commit b9e2318

Please sign in to comment.