From a0d3690dcc4100282f7a6b1e880531ec0fde5eda Mon Sep 17 00:00:00 2001 From: Yasser Tahiri Date: Fri, 17 Jan 2025 10:01:25 +0100 Subject: [PATCH] :sparkles: add Slack integration for alert notifications (#53) --- .env.example | 1 + prometheus/alertmanager.yml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.env.example b/.env.example index 13b7f14..3dd4829 100644 --- a/.env.example +++ b/.env.example @@ -25,6 +25,7 @@ IGNORE_PUBLISHERS=BINANCE # Prometheus TELEGRAM_TOKEN= OPSGENIE_API_KEY= +SLACK_API_URL= # Server PORT PORT=8080 \ No newline at end of file diff --git a/prometheus/alertmanager.yml b/prometheus/alertmanager.yml index b124b48..f978464 100644 --- a/prometheus/alertmanager.yml +++ b/prometheus/alertmanager.yml @@ -1,5 +1,6 @@ global: resolve_timeout: 5m + slack_api_url: "${{SLACK_API_URL}}" route: # When a new group of alerts is created by an incoming alert, wait at @@ -41,6 +42,12 @@ route: severity: critical continue: true + - receiver: "Slack-internal" + group_wait: 10s + match_re: + severity: warning + continue: true + receivers: - name: "internal-warning" telegram_configs: @@ -48,6 +55,10 @@ receivers: chat_id: -1001904637278 parse_mode: "HTML" message: '{{ template "telegram.default.message" . }}' + - name: "Slack-internal" + slack_configs: + - channel: "#internal-warning" + send_resolved: false - name: "internal-critical" opsgenie_configs: - api_key: "${{OPS_GENIE_API_KEY}}"