How do you validate Alertmanager configuration in CI?
BeginnerProductionObservability as Code, Security & Vendor Choices
Answer
Two checks with amtool: syntax and routing behaviour.
amtool check-config alertmanager.yml
amtool config routes show --config.file=alertmanager.yml
amtool config routes test --config.file=alertmanager.yml \
severity=critical team=payments # prints the receiver that would get it
We keep a small table of label sets and expected receivers in the repo and fail the pipeline when routes test output differs. That catches the classic bug of a new route placed below a catch-all with no continue.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateWhat does a CI pipeline for Prometheus rules look like?IntermediateRaw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?AdvancedWhat are monitoring mixins and how do you consume them?AdvancedHow do Grafana dashboards get loaded automatically in `kube-prometheus-stack`?Beginner