Creating a new template

Before we dive into creating a template, we must first realize what kind of data structures are sent to the notification templates. The following table depicts the available variables that can be used:

Variable

Description

Alerts

A list of Alert structures, each one with its own Status, Labels, Annotations, StartsAt, EndsAt, and GeneratorURL

CommonAnnotations

The annotations that are common to all alerts

CommonLabels

The labels that are common to all alerts

ExternalURL

The URL for the Alertmanager that sent the alert

GroupLabels

The labels that are used in the grouping of alerts

receiver

The receiver that will handle the notification

status

This will be firing as long ...

Get Hands-On Infrastructure Monitoring with Prometheus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.