Skip to main content

Module template

Module template 

Source
Expand description

Per-provider message templates.

Each provider entry in signal.yaml may carry a template map that replaces the text of one or more parts of the message it sends, such as Slack’s text or PagerDuty’s summary. Templates use Jinja syntax (rendered with minijinja), and see every signal field by name: {{ title }}, {{ severity }}, {{ metadata.dag_id }}.

Anything a template does not set keeps the built-in format, so a config without templates sends exactly what it always did.

Mistakes are caught when the config loads: a syntax error, a part the provider doesn’t have (providers.slack.template.txt) or an unknown variable ({{ tittle }}) is a config error. A template that still fails at send time, or renders to nothing but whitespace, is logged and the built-in format is sent instead: a broken template must never cost the alert.

Structs§

Templates
One provider’s compiled templates.

Constants§

SIGNAL_VARIABLES
Signal fields a template can use. Optional fields the signal doesn’t set are undefined, so {% if message %} works and {{ message }} renders as nothing.

Functions§

render
Renders part with templates if there are any, else None.

Type Aliases§

TemplateConfig
A provider’s template map: part name to template source.