Verify Alertmanager is running
Check Alertmanager’s systemd status:Create Prometheus alerting rules
Create/etc/prometheus/rules.yaml and define your alert groups. Below is a minimal example for detecting a node being down:
/etc/prometheus/rules.yaml:
Rule
labels are critical: they enable Alertmanager to match, group, and route alerts. Use annotations for human-readable alert text and details.
After saving rules, restart Prometheus:

prometheus.yml includes the rule_files entry and your scrape targets.
Example /etc/prometheus/prometheus.yml:
for.
Triggering alerts and how for works
Prometheus evaluates alert expressions on its schedule. Alerts follow this lifecycle:
- Pending: expression is true but
forduration not yet reached. - Firing: expression remained true for the full
forduration.
for delay:
for: 0m alerts become firing immediately. With for: 1m or higher, Prometheus waits before transitioning to firing.
Configure Prometheus to send alerts to Alertmanager
Tell Prometheus where Alertmanager is by adding analerting section to /etc/prometheus/prometheus.yml:

alertname and sends to the default receiver. To group or route alerts differently (for example by team and env), edit Alertmanager’s config at /etc/alertmanager/alertmanager.yml.
Alertmanager routing and Slack receiver
This example Alertmanager configuration:- Matches alerts from specific jobs using
match_re, - Groups alerts by
teamandenv, - Sends notifications to a Slack webhook receiver.
/etc/alertmanager/alertmanager.yml:
Key notes:
match_reselects alerts by label using regular expressions.group_by: ['team', 'env']bundles alerts that share those label values into a single message.- Slack receiver templates use
.GroupLabelsfor group-level info and iterate over.Alertsto include each alert’s.Annotations.message.
Grouping by labels such as
team and env reduces notification noise by bundling related alerts into one message per label combination.team and env. Expand groups to see individual alerts and annotations:

Verify Slack notifications
If the Slack webhook and channel are configured correctly, Alertmanager will post grouped messages to the specified Slack channel. Example formatted messages for this demo:
Final notes and links
- The same routing/grouping concepts apply to other integrations such as PagerDuty or Microsoft Teams; replace
slack_configswith the appropriate receiver config. - Validate Alertmanager config before deploying changes; for complex templates test in a staging environment first.
- Use labels consistently across rules and targets (e.g.,
team,env,job) to simplify grouping and routing.
- Prometheus docs: https://prometheus.io/docs/
- Alertmanager docs: https://prometheus.io/docs/alerting/latest/alertmanager/
- Slack incoming webhooks: https://api.slack.com/messaging/webhooks
- PagerDuty + Prometheus: https://support.pagerduty.com/docs/prometheus
- Microsoft Teams webhooks: https://learn.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook