47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
|
|
apiVersion: monitoring.coreos.com/v1alpha1
|
||
|
|
kind: AlertmanagerConfig
|
||
|
|
metadata:
|
||
|
|
name: telegram-notifications
|
||
|
|
namespace: prometheus
|
||
|
|
labels:
|
||
|
|
app: kube-prometheus-stack-alertmanager
|
||
|
|
release: prometheus
|
||
|
|
spec:
|
||
|
|
route:
|
||
|
|
groupBy: ['alertname', 'cluster', 'service']
|
||
|
|
groupWait: 10s
|
||
|
|
groupInterval: 5m
|
||
|
|
repeatInterval: 12h
|
||
|
|
receiver: telegram
|
||
|
|
routes:
|
||
|
|
- matchers:
|
||
|
|
- name: alertname
|
||
|
|
value: Watchdog
|
||
|
|
matchType: "="
|
||
|
|
receiver: 'null'
|
||
|
|
receivers:
|
||
|
|
- name: telegram
|
||
|
|
telegramConfigs:
|
||
|
|
- botToken:
|
||
|
|
name: alertmanager-telegram-secret
|
||
|
|
key: TELEGRAM_BOT_TOKEN
|
||
|
|
chatID: 124317807
|
||
|
|
parseMode: HTML
|
||
|
|
sendResolved: true
|
||
|
|
disableNotifications: false
|
||
|
|
message: |
|
||
|
|
{{ if eq .Status "firing" }}🔥 FIRING{{ else }}✅ RESOLVED{{ end }}
|
||
|
|
|
||
|
|
{{ range .Alerts }}
|
||
|
|
📊 <b>{{ .Labels.alertname }}</b>
|
||
|
|
{{ .Annotations.summary }}
|
||
|
|
|
||
|
|
{{ if .Annotations.node }}🖥 <b>Node:</b> <code>{{ .Annotations.node }}</code>{{ end }}
|
||
|
|
{{ if .Annotations.pod }}📦 <b>Pod:</b> <code>{{ .Annotations.pod }}</code>{{ end }}
|
||
|
|
{{ if .Annotations.namespace }}📁 <b>Namespace:</b> <code>{{ .Annotations.namespace }}</code>{{ end }}
|
||
|
|
{{ if .Annotations.throttle_rate }}⚠️ <b>Throttling rate:</b> {{ .Annotations.throttle_rate }}{{ end }}
|
||
|
|
|
||
|
|
🔗 <a href="{{ .GeneratorURL }}">View in Grafana</a>
|
||
|
|
{{ end }}
|
||
|
|
- name: 'null'
|