global:
slack_api_url: '<your_slack_api_url>'
route:
receiver: slack-notifications
group_by: [alertname]
receivers:
- name: slack-notifications
slack_configs:
- channel: '#monitoring-alerts'
title: '{{ template "slack.default.title" . }}'
text: '{{ template "slack.default.text" . }}'
alerting:
alertmanagers:
- static_configs:
- targets:
- alertmanager:9093
groups:
- name: my-group
rules:
- alert: high-cpu-usage
expr: node_cpu_seconds_total{mode="idle"} < 10 for: 5m
labels:
severity: critical
annotations:
summary: "High CPU usage detected"
description: "The CPU usage on the node {{ $labels.instance }} is above the threshold of 10% for the last 5 minutes."
receivers:
- name: telegram-notifications
webhook_configs:
- url: "https://api.telegram.org/bot<your_bot_token>/sendMessage?chat_id=@<your_chat_id>"
send_resolved: true
http_config:
bearer_token: "<your_bot_token>"
groups:
- name: my-group
rules:
- alert: high-cpu-usage
expr: node_cpu_seconds_total{mode="idle"} < 10
for: 5m
labels:
severity: critical
annotations:
summary: "High CPU usage detected"
description: "The CPU usage on the node {{ $labels.instance }} is above the threshold of 10% for the last 5 minutes."
receivers:
- telegram-notifications