Skip to main content

Alert Rules

What are Alert Rules

Alert rules control which incoming signals trigger automatic investigations. They act as filters between your monitoring systems and OpsWorker's investigation engine, so that only the alerts you care about are investigated.

Alert rules are configured per cluster. An alert that matches a rule on its cluster triggers an investigation; an alert that matches no rule is recorded but not investigated.

How Rules Work

When a signal arrives, OpsWorker evaluates it against the alert rules for that cluster:

flowchart LR
A[Signal arrives] --> B{Matches a rule on this cluster?}
B -->|Yes| E[Investigation starts]
B -->|No| D[Signal recorded only]

Rule Configuration

Each alert rule is scoped to a cluster and matches on the following fields. The severity and label matchers are key plus filter pairs, where the filter is a Go RE2 regular expression.

FieldDescriptionExample
NameA label for the rule"Critical production alerts"
NamespaceRE2 regex matching the Kubernetes namespaceprod-.* (all production namespaces)
Severity key + filterLabel key to read severity from, plus an RE2 filter on its valuekey severity, filter `critical
Label key + filterAny alert label key, plus an RE2 filter on its valuekey service, filter payment

A rule matches when all of its configured fields match the incoming alert. There is no separate enable/disable or auto-investigate toggle; a matching rule triggers an investigation.

Examples

Rule NameFieldsPurpose
Critical production alertsNamespace prod-.*, severity filter criticalInvestigate all critical alerts in production
Payment serviceLabel service filter paymentInvestigate all alerts for the payment service
Staging warnings and aboveNamespace staging, severity filter `warningcritical`

Best Practices

  • Start narrow: begin with critical alerts in production, then expand as you gain confidence.
  • Use namespace patterns: filter by namespace regex to cover groups of related services.
  • Review regularly: use the daily digest and the dashboard to identify rules that should be added or adjusted.

Next Steps