Incident management · Production

Booking.com builds Granomaly: a statistical anomaly detection service for time series business metrics

The problem

Static thresholds and naive week-over-week comparison failed to reliably catch anomalies in fluctuating business metrics like daily sales or order volume, because an anomaly in one week became the flawed baseline for the next.

First attempt

Several approaches were tried and abandoned before arriving at the final design: z-score alerting caused a spike in false alarms at night due to low user activity, was not human-readable, and Graphite lacked usable sliding-window support. A percentile-based range was distorted by overlapping past outages, and an approach that excluded the most deviant historical week always removed a data point even when no true outlier existed, producing an unstable range.

Workflow diagram · grounded in source
1
Historical data read from Graphite
trigger
“Reads historical data from Graphite (e.g., 4–5 weeks of data for a specific metric)”
2
Outlier exclusion via z-score normalization
ai_action
“Instead of filtering based on a fixed z-score threshold, we perform z-score normalization by calculating the median of all z-score values … keep any data point whose normalized z-score stays within a threshold of 0.6. This threshold was …”
3
Prediction range calculation
ai_action
“We then calculate the Nth percentile as the lower bound and the (100-N)th percentile as the upper bound”
4
Range written back to Graphite
integration
“Writes the range back to Graphite as two separate metrics”
5
Anomaly detection in Grafana
validation
“whenever a value falls outside the predicted range, it is considered an anomaly”
6
Dual alert output
output
“we set up two alerts: one for significant drops and another for a gradual decline over an extended period”
Reported outcome

Granomaly produces a smoothed prediction range that Grafana uses to detect both sudden outages and slow gradual declines, handles overlapping historical anomalies, and supports event-specific corrections; a simulation feature reduced the parameter-tuning feedback loop from days to seconds.

Reported metrics
Parameter-tuning feedback loopreducing the feedback loop from days to seconds
Reported stack
GraphiteGrafanaGranomaly
Source
https://medium.com/booking-com-development/anomaly-detection-in-time-series-using-statistical-analysis-cc587b21d008
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Granomaly produces a smoothed prediction range that Grafana uses to detect both sudden outages and slow gradual declines, handles overlapping historical anomalies, and supports event-specific corrections; a simulation…

What tools did this team use?

Graphite, Grafana, Granomaly.

What results were reported?

Parameter-tuning feedback loop: reducing the feedback loop from days to seconds (source-reported, not independently verified).

What failed first in this deployment?

Several approaches were tried and abandoned before arriving at the final design: z-score alerting caused a spike in false alarms at night due to low user activity, was not human-readable, and Graphite lacked usable sl…

How is this incident management AI workflow structured?

Historical data read from Graphite → Outlier exclusion via z-score normalization → Prediction range calculation → Range written back to Graphite → Anomaly detection in Grafana → Dual alert output.