Skip to main content

Overview

By referencing variables from alert labels and attributes, you can modify and customize incident severity, title, description, and other information. This is primarily used in two scenarios:

Event API Reporting

When reporting custom alert events with the alert Event API, you can use the title_rule field to customize the alert title.

Alert Pipeline

Reference variables in alert pipelines to modify alert severity, title, description, and other information.

Event API example

Specifies resource and check labels as the alert title.

Alert pipeline example

Reference Variables in Alert Pipeline

Variable reference methods

Reference labels with ${var}

Use [TPL] as prefix and ${} to reference variables. Variable content is extracted from labels; if extraction fails, <no value> is used as a placeholder.

Reference with Go template syntax

Use [TPL] as prefix and {{}} to reference variables (can reference both labels and attributes); a missing label shows <no value>. Reference a specific label as {{.Labels.name}}.
The two syntaxes differ in data scope: ${name} reads only from labels, not attribute fields, while {{}} can use the fields in the table below and labels. When a label is missing, both syntaxes show <no value>.

Supported attributes

When you use {{}} syntax, you can reference these alert fields:
The alert description and any label value also support reference variables. In an alert pipeline, the Reset Description (resetDescription) and Reset Labels (resetLabels) actions substitute variables in any content prefixed with [TPL].

FAQ

With either ${} or {{}}, a missing label shows as <no value> at that position in the title.
Even if a variable cannot be retrieved, it won’t affect alert generation. You can debug with confidence.