Skip to content

Instantly share code, notes, and snippets.

@MartinHeinz
Created March 29, 2023 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinHeinz/8a4160fd319bd81664ed75bdd0eb722c to your computer and use it in GitHub Desktop.
Save MartinHeinz/8a4160fd319bd81664ed75bdd0eb722c to your computer and use it in GitHub Desktop.
# https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L140
# helm upgrade monitoring prometheus-community/kube-prometheus-stack -f values-prom.yaml
alertmanager:
config:
global:
resolve_timeout: 5m
inhibit_rules:
- source_matchers:
- 'severity = critical'
target_matchers:
- 'severity =~ warning|info'
equal:
- 'namespace'
- 'alertname'
- source_matchers:
- 'severity = warning'
target_matchers:
- 'severity = info'
equal:
- 'namespace'
- 'alertname'
- source_matchers:
- 'alertname = InfoInhibitor'
target_matchers:
- 'severity = info'
equal:
- 'namespace'
route:
group_by: [ 'namespace' ]
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'null'
routes:
- receiver: 'null'
matchers:
- alertname =~ "InfoInhibitor|Watchdog"
- receiver: synthetics-alerts
group_by: [ '...' ]
match_re:
namespace: kuberhealthy
receivers:
- name: 'null'
- name: synthetics-alerts
slack_configs:
- channel: alerts
send_resolved: true
title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] Monitoring Event Notification'
text: >-
{{ range .Alerts }}
*Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
*Description:* {{ .Annotations.description }}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
{{ end }}
{{ end }}
api_url: >-
https://hooks.slack.com/services/...
templates:
- '/etc/alertmanager/config/*.tmpl'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment