Skip to content

Commit

Permalink
Adding initial examples for alertmananger
Browse files Browse the repository at this point in the history
Parking intial slack and encore configuration examples for alertmanager
  • Loading branch information
BjoernT committed Mar 11, 2024
1 parent f6c244a commit 4fea676
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/examples/alertmanager-encore.md
Original file line number Diff line number Diff line change
@@ -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:<ENCORE UUID>/webhook/mpk-alertmanager?secret=<SECRET KEY>&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
```
45 changes: 45 additions & 0 deletions docs/examples/alertmanager-slack.md
Original file line number Diff line number Diff line change
@@ -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/<slackwebhookhere>
channel: '#<slack-channel here>'
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
```

0 comments on commit 4fea676

Please sign in to comment.