Skip to main content
Use notification templates to control the title and description of notifications generated by a monitor. Templates are Go template strings expanded at notification time with alert context, so the notification can include signal data such as severity, labels, and threshold values. A notification template has two optional fields:
  • Title: The subject line or heading of the notification.
  • Description: The body text of the notification.
To add a notification template to a monitor, see Create a monitor or Edit a monitor. For the notification_template field definition, see the monitor data model.

Set a notification template

Add a notification_template block when creating or updating a monitor.
When you create or edit a monitor, use the Notification Template section to set the title and description of the notifications this monitor generates. Enter Go template strings that combine literal text with {{...}} placeholders, which expand with alert context at notification time.
  1. In the Title field, enter a template for the notification title.
  2. In the Description field, enter a template for the notification body.
Both fields are optional.

Error rate alert example

The following template uses severity and label variables to produce a notification title and description.
For a critical alert on the payments service in production, Chronosphere Observability Platform renders the notification as:

Template variables

Reference variables with dot notation, for example, {{.Severity}}.

Alert object fields

Each item in .Alerts, .Alerts.Firing, and .Alerts.Resolved exposes the following fields:

Template functions

In addition to the standard Go template built-ins, the following functions are available.

Arithmetic

String manipulation

Template examples

Count firing and resolved alerts

List all firing alerts

Show the resolve threshold conditionally

Reference the alert start time