monitoring(alertmanager): enable the alert sink and wire the 33 PrometheusRules (F5) (#42)
This commit is contained in:
commit
cea26863ec
1 changed files with 75 additions and 2 deletions
|
|
@ -5,9 +5,82 @@
|
|||
# Prometheus is capped twice (time AND bytes) so a metrics burst can never
|
||||
# repeat the ephemeral-storage / DiskPressure incident (see docs/cluster-overview.md).
|
||||
|
||||
# --- Alertmanager: off. No receivers in this card; alerts fire to nowhere on purpose.
|
||||
# --- Alertmanager: ON. It is the cluster's only alert sink; without it the
|
||||
# 33 PrometheusRules evaluate into nothing (finding F5). The receiver is the
|
||||
# dedicated alert bot @Siriusdevops_alert_bot (chat 7528130947) — the same bot
|
||||
# the public contact forms use and deliberately NOT the Hermes gateway bot the
|
||||
# agent/netsec waker runs on, so a cluster alert can never loop back into the
|
||||
# agent. The bot token is NOT in git: it lives in Secret
|
||||
# monitoring/alertmanager-telegram (created out of band) and the operator
|
||||
# mounts it at /etc/alertmanager/secrets/alertmanager-telegram/bot_token.
|
||||
#
|
||||
# Routing: default -> telegram. Watchdog (fires forever by design, the
|
||||
# dead-man's switch) and the InfoInhibitor meta-alert go to the 'null'
|
||||
# blackhole receiver so neither ever pages; info-severity noise (e.g.
|
||||
# CPUThrottlingHigh) stays in Prometheus/Grafana without paging. That route is
|
||||
# the durable silence — unlike an Alertmanager API silence it lives in git and
|
||||
# survives a pod reschedule. The inhibit_rules are the chart defaults (critical
|
||||
# inhibits warning/info, warning inhibits info) and are kept as-is.
|
||||
alertmanager:
|
||||
enabled: false
|
||||
enabled: true
|
||||
apiVersion: v2
|
||||
alertmanagerSpec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: siriussec
|
||||
resources:
|
||||
requests:
|
||||
cpu: 20m
|
||||
memory: 32Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 128Mi
|
||||
# Mounts Secret monitoring/alertmanager-telegram into the pod at
|
||||
# /etc/alertmanager/secrets/alertmanager-telegram/ (bot_token key).
|
||||
secrets:
|
||||
- alertmanager-telegram
|
||||
config:
|
||||
global:
|
||||
resolve_timeout: 5m
|
||||
route:
|
||||
group_by: ['namespace']
|
||||
group_wait: 30s
|
||||
group_interval: 5m
|
||||
repeat_interval: 12h
|
||||
receiver: 'telegram'
|
||||
routes:
|
||||
- matchers: ['alertname = "Watchdog"']
|
||||
receiver: 'null'
|
||||
- matchers: ['alertname = "InfoInhibitor"']
|
||||
receiver: 'null'
|
||||
- matchers: ['severity = "info"']
|
||||
receiver: 'null'
|
||||
inhibit_rules:
|
||||
- source_matchers: ['severity = "critical"']
|
||||
target_matchers: ['severity =~ "warning|info"']
|
||||
equal: ['namespace', 'alertname']
|
||||
- source_matchers: ['severity = "warning"']
|
||||
target_matchers: ['severity = "info"']
|
||||
equal: ['namespace', 'alertname']
|
||||
- source_matchers: ['alertname = "InfoInhibitor"']
|
||||
target_matchers: ['severity = "info"']
|
||||
equal: ['namespace']
|
||||
- target_matchers: ['alertname = "InfoInhibitor"']
|
||||
receivers:
|
||||
- name: 'null'
|
||||
- name: 'telegram'
|
||||
telegram_configs:
|
||||
- bot_token_file: /etc/alertmanager/secrets/alertmanager-telegram/bot_token
|
||||
chat_id: 7528130947
|
||||
send_resolved: true
|
||||
parse_mode: HTML
|
||||
message: |-
|
||||
{{ range .Alerts -}}
|
||||
<b>{{ if eq .Status "firing" }}FIRING{{ else }}RESOLVED{{ end }} [{{ .Labels.severity }}] {{ .Labels.alertname }}</b>
|
||||
{{ .Annotations.summary }}
|
||||
{{ .Annotations.description }}
|
||||
{{ end }}
|
||||
templates:
|
||||
- '/etc/alertmanager/config/*.tmpl'
|
||||
|
||||
defaultRules:
|
||||
create: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue