A per-minute p99 alert fires a few times every night, when traffic drops to about 20 requests a minute, and almost never by day. Diagnose it and fix it without hiding real regressions.
Sketch your own answer first, then compare it with the one below.
A strong answer
Start with the arithmetic. With 20 requests in the window, 1 percent is 0.2 of a request, so the p99 is the slowest request of the minute. By day, with 6,000 requests a minute, 60 requests sit above the p99, and one outlier cannot move it. At night a single slow request does. Slow requests arrive at about the same rate in both periods, but the night metric swings on each one.
Confirm it by plotting request count against alert time, and by checking that the alerting minutes each contain one or two slow requests. Then change what the alert measures.
Replace the percentile with a ratio: slow requests over all requests, in a window long enough to hold a meaningful number of them. Compare it with the budget rate, and use paired windows as in burn-rate alerting, say one hour confirmed by five minutes, so a lone slow request cannot page. At 20 requests a minute an hour holds 1,200, and a 99 percent target tolerates 12 slow ones.
Keep a safety valve for real trouble. A drastic failure at night still produces a high ratio in the short window, so it pages quickly. Also keep a daytime percentile on the dashboard for diagnosis. You have lost nothing except pages triggered by one request.
Sources
- Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne (2018). The Site Reliability Workbook, chapter: Alerting on SLOs.
- Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy (2016). Site Reliability Engineering, chapter: Monitoring Distributed Systems.