Alert Template Discipline

Alert messages should be informative. The template.

Why templates

Hand-rolled alerts vary in quality. Templates encode the team standard for required labels, runbook link, dashboard link, and severity rules; the discipline reduces review burden because the reviewer checks that the template was used, not whether every field is correct.

What a template includes

A useful template is opinionated about what every alert must carry. Required labels for ownership and routing, required annotations for human-readable context, and default routing rules so the alert reaches the right place by default.

Per-category variants

One template cannot cover every alert shape. Per-category variants for latency, error-rate, and saturation each take the inputs they need and emit the right query; the variants share the common label and annotation contract while specialising the query body.

How to enforce the template

Templates only matter if they are enforced. A Helm chart, Terraform module, or Jsonnet library wraps the template; authors call the function rather than write raw alert config. The linter rejects raw config that bypasses the wrapper, and the PR template asks which template was used and why.

Start small

Template adoption is a long game. Pick the 3 most common alert shapes and build templates for those first; don’t try to template every edge case on day one. Adoption percentage is the leading indicator: under 80% after 6 months means the templates are too rigid.