Recipe
Time-series anomaly rule generator
Build detection rules that fire when a metric deviates from its rolling baseline.
Overview
This recipe ingests a time-series stream, computes a rolling mean and standard deviation over a configurable window, and emits an alert when the current value exceeds μ + kσ.
Parameters
| Name | Type | Default |
|---|---|---|
| window_seconds | int | 300 |
| k_factor | float | 3.0 |
| min_samples | int | 10 |
Example rule
rule anomaly_latency {
metric = "http_request_duration_ms"
window = 300s
threshold = 3.0 * stdev
min_samples = 10
action = alert
}