Notifiers
When an alert triggers, it sends a notification based on a notifier, which is an endpoint you specify that defines where to deliver active alerts and who to notify. When creating a notification policy, you select a notifier that specifies where to route the alert.
Notifiers trigger every 60 minutes by default, meaning for every 60 minutes an alert triggers, a new notification sends for each defined notification policy.
A single alert results in one notification, which can be either warn
or critical
.
If there are multiple time series, the alert is de-duplicated, and activates only
once. However, the alert indicates which time series are violating the condition.
Chronosphere Observability Platform supports the following notifiers:
Prerequisites
Some notifier configurations require specific information, such as a service key or an API key. The required information depends on the type of notifier that you're creating. Refer to each notifier's configuration to determine the necessary information.
Users cannot modify Terraform-managed resources in the user interface, with Chronoctl, or by using the API. Learn more.
View notifiers
You can view available notifiers in Observability Platform, or return a list of notifiers using Chronoctl. You can view notifiers created by Terraform in Observability Platform, but you can't modify them.
To view a notifier:
- In the navigation menu select Alerts > Notifiers.
- Search for the notifier you want to view and select it from the list.
The Edit Notifier page displays the notifier definition.
Create a notifier
Notifiers use a custom definition format in YAML. You can use Observability Platform, Chronoctl, or the Chronosphere Terraform provider to create and manage them. Notifiers support variables and templating.
After creating a notifier, you can select it when defining a notification policy.
The following steps apply to creating notifiers. See each notifier page for examples of creating that specific notifier type.
To create a notifier:
- In the navigation menu select Alerts > Notifiers.
- Click Create notifier.
- Enter a descriptive name for the notifier.
- Select the type of notifier you want to create.
- Enter the required information for the notifier.
- Click Save.
Edit a notifier
Select from the following methods to edit a notifier.
Users cannot modify Terraform-managed resources in the user interface, with Chronoctl, or by using the API. Learn more.
To edit a notifier:
- In the navigation menu select Alerts > Notifiers.
- Search for the notifier you want to view and select it from the list.
- In the Edit Notifier page, make changes to the notifier definition.
- Click Save.
Delete a notifier
Select from the following methods to delete a notifier.
Users cannot modify Terraform-managed resources in the user interface, with Chronoctl, or by using the API. Learn more.
To delete a notifier:
- In the navigation menu select Alerts > Notifiers.
- Search for the notifier you want to delete and select it from the list.
- In the Edit Notifier page, click the delete icon .
- In the confirmation dialog, click Delete.
Notifications for alerts in third-party services
By default, Observability Platform sends a notification when an alert for a monitor resolves in third-party services, such as PagerDuty and VictorOps. You can choose to not send notifications by configuring the specified parameter in the Chronoctl YAML definition or Terraform resource for your notifier.
If you create a notifier with Observability Platform, notifications are never sent when an alert resolves. You can modify this behavior only for notifiers created using Chronoctl, Terraform, or the Chronosphere API.
To skip notifications when alerts for a monitor resolve, set the value of the
skip_resolved
property to true
in your notifier definition.
For example, the following definition skips sending notifications for resolved alerts for an Opsgenie notifier:
api_version: v1/config
kind: Notifier
spec:
name: test-opsgenie
slug: test-opsgenie
skip_resolved: true
opsgenie:
…
Use variables in notifiers
Notification content supports Go templates (opens in a new tab) and Prometheus Alertmanager variables (opens in a new tab). Notifiers support many features and variables demonstrated in Alertmanager notification examples (opens in a new tab).
Available variables
You can reference Prometheus Alertmanager variables with the {{.VARIABLE_NAME }}
syntax. Variable references work in the notifier's definition and the notification's
contents.
Notifiers can access monitor labels by using variables with the
{{ .CommonLabels.LABEL }}
pattern, and from the alerting metric with the
{{ .Labels.LABEL }}
pattern. In both patterns, replace LABEL
with the
label's name.
Similarly, you can reference monitor-defined annotations by using the
{{ .CommonAnnotations.ANNOTATION }}
pattern, replacing ANNOTATION
with
the monitor annotation's name.
If your monitor query includes a label that generates different annotation values,
then annotations won't be included in CommonAnnotations
or CommonLabels
.
See the Alertmanager documentation (opens in a new tab) for a reference list of alerting variables and templating functions.
Variable usage examples
This Slack notifier's channel
value takes advantage of monitor-defined labels to post a
notification to a channel based on a triggering metric's label:
api_version: v1/config
kind: Notifier
spec:
notifier:
name: slack-notifier
slug: slack-notifier
slack:
…
channel: "metric-notification-{{ .CommonLabels.<LABEL> }}"
…
You can also reference annotations defined in the monitor:
api_version: v1/config
kind: Notifier
spec:
notifier:
name: slack-notifier
slug: slack-notifier
slack:
…
text: "Summary: {{ .CommonAnnotations.summary }}"
…