From 4fea676d74399bc1a5365d9c00ece5f57630518b Mon Sep 17 00:00:00 2001 From: Bjoern Teipel Date: Mon, 11 Mar 2024 11:08:21 -0500 Subject: [PATCH] Adding initial examples for alertmananger Parking intial slack and encore configuration examples for alertmanager --- docs/examples/alertmanager-encore.md | 44 +++++++++++++++++++++++++++ docs/examples/alertmanager-slack.md | 45 ++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 docs/examples/alertmanager-encore.md create mode 100644 docs/examples/alertmanager-slack.md diff --git a/docs/examples/alertmanager-encore.md b/docs/examples/alertmanager-encore.md new file mode 100644 index 00000000..282b12ac --- /dev/null +++ b/docs/examples/alertmanager-encore.md @@ -0,0 +1,44 @@ + +The following example describes configuration options to send alerts via alertmanager to +Rackspace encore, the `Encore UUID` is derived by account where the secret `SECRET KEY` is +used per application submitting webhooks: + +```yaml +global: + resolve_timeout: 5m +receivers: +- name: default-receiver +- name: watchman-webhook +- name: critical-alert-manager-handler + webhook_configs: + - url: https://watchman.api.manage.rackspace.com/v1/mpk:/webhook/mpk-alertmanager?secret=&severity=high + - url: http://prometheus-msteams.rackspace-system.svc:2000/critical +- name: warning-alert-manager-handler + webhook_configs: + - url: http://prometheus-msteams.rackspace-system.svc:2000/warning +route: + group_by: + - alertname + - severity + - cluster + - region + group_wait: 10s + group_interval: 5m + repeat_interval: 12h + receiver: watchman-webhook + routes: + - match: + severity: critical + receiver: watchman-webhook + routes: + - match_re: + namespace: kube-system|rackspace-system + receiver: critical-alert-manager-handler + #- match_re: + # severity: warning + # receiver: watchman-webhook + # routes: + # - match_re: + # namespace: kube-system|rackspace-system + # receiver: warning-alert-manager-handler +``` diff --git a/docs/examples/alertmanager-slack.md b/docs/examples/alertmanager-slack.md new file mode 100644 index 00000000..7a7ef539 --- /dev/null +++ b/docs/examples/alertmanager-slack.md @@ -0,0 +1,45 @@ + +The following example describes configuration options to send alerts via alertmanager to slack +using a slack hook. + +```yaml +alertmanager: + alertmanagerSpec: + image: + repository: docker.io/prom/alertmanager:v0.20.0 + config: + global: + resolve_timeout: 5m + receivers: + - name: default-receiver + - name: watchman-webhook + - name: warning-alert-manager-handler + slack_configs: + - api_url: https://hooks.slack.com/services/ + channel: '#' + send_resolved: true + text: >- + {{- if .CommonAnnotations.summary -}} + *Summary*: {{- .CommonAnnotations.summary -}}{{- "\n" -}} + {{- else if .CommonAnnotations.description -}} + *Description*: {{- .CommonAnnotations.description -}}{{- "\n" -}} + {{- else if .CommonAnnotations.message -}} + *Message*: {{- .CommonAnnotations.message -}}{{- "\n" -}} + {{- end -}} + *Cluster*: {{ .GroupLabels.cluster }} + *Wiki*: https://desired.wiki.page/{{ .GroupLabels.alertname }} + route: + group_by: + - alertname + - severity + - cluster + - region + group_interval: 5m + group_wait: 10s + receiver: watchman-webhook + repeat_interval: 12h + routes: + - match_re: + severity: critical + receiver: warning-alert-manager-handler +```