Skip to main content
This feature isn’t available to all Chronosphere Observability Platform users and might not be visible in your app. For information about enabling this feature in your environment, contact Chronosphere Support.
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.
Include a notification_template block in your monitor YAML when running chronoctl monitors create or chronoctl monitors update. For more information, see Chronoctl.

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