Skip to Content
KubeSense

Templates & Import

Alert rule templates

Clicking Create New Alert Rule opens a template picker so you don't start from a blank query.

Alert Rule Templates

Recipes are complete, ready-to-tune rules organised by category:

CategoryExamples
KubernetesHigh pod CPU (sustained CPU above threshold, per pod)
LogsLog errors (error count), Log error % (errors as a percentage of all logs, per workload)
TracesAPI 5xx errors (HTTP server errors per workload), API latency increase (p95 vs an hour ago), API success rate (non-5xx percentage per workload)
AWS ECSService below desired tasks, tasks stuck pending, service CPU high, service memory high, cluster CPU reservation high, container restarting, container unhealthy
Data StreamsConsumer lag high, consumer lag growing, topic throughput drop, stream latency high, stream errors

Data Streams and AWS ECS recipes in the template picker

AWS ECS

Built on the AWS cloud metrics KubeSense collects for ECS (see AWS resource metric collection). Service recipes alert per ecs_cluster, ecs_service.

RecipeFires whenStarts at
ECS service below desired tasksRunning tasks are fewer than desired< 0 (running − desired), Critical
ECS tasks stuck pendingTasks have been pending for 15 minutes straight> 0, Warning
ECS service CPU highCPU use as a percentage of the reservation> 85%, Warning
ECS service memory highMemory use as a percentage> 90%, Warning
ECS cluster CPU reservation highThe cluster's CPU is nearly all reserved> 90%, Warning
ECS container restartingA container's restart count went up in the last 15 minutes> 0, Warning
ECS container unhealthyA container reports unhealthy> 0, Critical

Data Streams (Kafka)

The first three read Confluent Cloud metrics; the last two read Kafka spans from your traces (see Data Streams).

RecipeFires whenStarts at
Consumer lag highLag per consumer group and topic> 10,000, Warning
Consumer lag growingLag is up compared with an hour ago> 50%, Warning
Topic throughput dropRecords received are down compared with an hour ago< −50%, Warning
Stream latency highp95 span duration per topic> 500 ms, Warning
Stream errorsError spans per topic and workload> 5, Critical

Recipes come pre-configured with the right filters and grouping — for example, the trace templates scope to HTTP traffic and group by workload so each service alerts independently — and land you in the editor with everything filled in, ready to adjust the threshold and pick channels.

Alert type starters pre-configure just the condition shape — Threshold, Ratio, Change, New Value — and leave the query to you. SLO burn rate and SLO error budget balance start an SLO alert.

Markdown in descriptions

The description is the runbook a responder reads when the alert fires — what it means, and what to do about it. It accepts markdown, so it can be more than one line:

## What's happening

Error rate above threshold on {{workload}}.

## First checks

1. One pod or all of them? Group by `pod` on the alert page.
2. Check recent deploys — this usually follows one.

```sh
kubectl rollout history deploy/{{workload}} -n {{namespace}}
```

Headings, bold, italic, lists, tables, links, inline code, fenced code blocks and horizontal rules all work. The editor has a formatting toolbar and an Edit / Preview toggle; Preview renders exactly what the alert pages show, so check a long runbook there before saving.

Descriptions appear rendered on the alert event and alert rule detail pages, collapsed behind a Show more toggle when long, so a three-screen runbook doesn't push the timeline off the page.

note: Notification channels receive the markdown as you typed it, not as rendered HTML — and Slack's formatting is not markdown. (A channel using a custom message template is the exception: that template decides the message, so the description appears only if it asks for one.) In Slack, *single asterisks* are bold, while **double**, # headings, tables, - lists and [text](url) links all render literally. If Slack is your main delivery path, keep the first line or two meaningful on their own and prefer plain prose and code blocks over tables and headings.

Placeholders in names and descriptions

Rule names and descriptions support {{label}} placeholders that resolve per instance in notifications and on the alert pages — e.g. High CPU on {{pod}} in {{namespace}} becomes High CPU on checkout-6f7b… in production. Any label on the alert works: group-by values, static rule labels, and built-ins like severity. A placeholder that doesn't match a label is left as-is, so double-check spelling against your group-by fields.

Put {{logs_link}} or {{trace_link}} in a rule's description and each notification carries a link that opens the Logs or Traces explorer already filtered to what fired: the rule's filters, narrowed to the one series that fired (that pod, that workload), over the window the evaluation looked at.

Error rate above threshold on {{workload}}.

{{logs_link}}

{{trace_link}}
  • {{logs_link}} needs a logs query in the rule, and {{trace_link}} a traces query; otherwise it renders empty. {{log_link}} and {{traces_link}} work too, as do {{Alert.logsLink}} and {{Alert.traceLink}}.
  • Put each link on a line of its own — it renders as a labelled link, and text sharing its line can be lost.
  • The links work in rule descriptions, not in notification message templates.
  • If one of your group-by labels is itself called logs_link or trace_link, the label's value wins.
  • A rule created through the API without the editor's filters gets a link narrowed to the series and time window only.
  • Someone without access to Logs or Traces sees a "no access" page.

note: The links need the KubeSense address to be configured on the rule engine (WEBAPP_URL). Without it they render empty.

Importing and exporting rules

  • Import — the Import button on the Alert Rules tab accepts one rule or an array of rules as JSON. Every rule is validated upfront (query fields, group-by columns, filters) with a dry-run summary showing what passes and what fails — nothing is created until you confirm.
  • Export — every rule's detail page has an Export action that downloads it as re-importable JSON (live state stripped), useful for promoting rules between environments or checking them into git.
  • Migrating from Datadog? See Datadog Alert Migration for converting Datadog monitors into KubeSense alert rules in bulk.

Notification message templates

The Alert Templates tab customises what notifications look like, per channel type — overriding the built-in message layout for Slack, Teams, Email, Google Chat, and Webhook deliveries.

Notification Message Templates

  • Create a template for a channel type, edit the message fields it exposes (title, body, etc.), and use the same {{label}} placeholders plus alert fields (value, threshold, status) in the content.
  • Preview renders the template with sample alert data before you save.
  • Clone an existing template to iterate on a variant.

Without a custom template, channels use the built-in layout described in Integrations — including the per-alert View in Kubesense deep link to the exact firing instance.

note: Datadog On-Call doesn't support templates — its paging API mandates a fixed JSON schema, so the template picker is hidden for that channel type. Every other channel type, including Jira Service Management, is templatable.

On this page