1. Rules #
What Kibana watches.
Rule types #
| Rule type | Usage |
|---|---|
| Elasticsearch query (KQL, DSL or ES|QL) | Alert when a query returns results or exceeds a threshold |
| Custom threshold | Threshold on an aggregation of logs or metrics, with grouping |
| Log threshold | Number of logs matching a criterion |
| APM (latency, error rate, anomaly) | Thresholds on instrumented services |
| SLO burn rate | Error budget consumption |
| Index threshold | Simple aggregation on an index |
// Règle ES|QL : plus de 50 erreurs 5xx en 5 minutes pour un service
FROM logs-*
| WHERE @timestamp > NOW() - 5 minutes AND http.response.status_code >= 500
| STATS erreurs = COUNT(*) BY service.name
| WHERE erreurs > 502. Connectors and actions #
Where notifications go.
Configuring #
A connector (email, Slack, Teams, webhook, PagerDuty, Jira, ServiceNow, index, server log...) is defined once and reused by rules. Each action picks a connector, a message (with variables such as {{context.message}} or {{alert.id}}) and a frequency.
| Setting | Effect |
|---|---|
| Check frequency | Every minute, 5 minutes... |
| Summary or per alert | One grouped notification or one per alert |
| Notify on status change | Avoids repetitions |
| Maintenance windows | Suspend notifications during an intervention |
| Recovered | Notify when the alert resolves |
Good to know: Depending on the Elastic license, some connectors (Slack, webhook, PagerDuty...) are not available on the free license; the Index and Server log connectors are.
3. SLOs #
Objectives in Elastic Observability.
Defining an SLO #
The SLO application computes an SLI from a query (custom KQL, APM metrics, histogram), a target (99.5%) and a window (rolling 30 days), then automatically creates burn rate alerts.
Indicateur : Custom query
Index : logs-nginx.access-*
Bons événements : http.response.status_code < 500
Total : *
Objectif : 99.5 % sur 30 jours glissants
Alerte : burn rate (fenêtres longues et courtes) vers le connecteur d'astreinteGood practice: The concepts (ratio SLI, budget, multi-window burn rate) are those detailed in the SRE course: mastering them makes these screens immediately understandable.
