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 }}
📊 {{ .Labels.alertname }}
{{ .Annotations.summary }}
{{ if .Annotations.node }}🖥 Node: {{ .Annotations.node }}{{ end }}
{{ if .Annotations.pod }}📦 Pod: {{ .Annotations.pod }}{{ end }}
{{ if .Annotations.namespace }}📁 Namespace: {{ .Annotations.namespace }}{{ end }}
{{ if .Annotations.throttle_rate }}⚠️ Throttling rate: {{ .Annotations.throttle_rate }}{{ end }}
🔗 View in Grafana
{{ end }}
- name: 'null'