Skip to content

Instantly share code, notes, and snippets.

View robbat2's full-sized avatar

Robin H. Johnson robbat2

View GitHub Profile
@robbat2
robbat2 / alertmanager_templates_howto.md
Created December 21, 2024 07:38 — forked from vi7/alertmanager_templates_howto.md
Alertmanager templates testing

Render Alertmanager templates locally

Normally to test Alertmanager templates you need to restart running Alertmanager and wait for alerts to arrive to Slack or email. To speed up this process parts of templates could be rendered locally using predefined alerts data without the need of the actual Alertmanager.

What you still need in this case is amtool which is a part of Alertmanager delivery which could be downloaded here https://github.com/prometheus/alertmanager/releases

Some examples of templates rendering:

# navigate to the templates dir
From: "Robin H. Johnson" <[email protected]>
To: [email protected]
Cc: [email protected]
Reply-To: [email protected]
Bcc:
Subject: Gentoo Infrastructure Hosting Sponsors needed - older sponsors going away
Hi all,
The world economic climate has not been kind to some of our Gentoo