Beta: Managed ClickStack onlyAnomaly detection alerts are in beta and available in Managed ClickStack. They aren’t available in ClickStack Open Source. Behavior and defaults may change while the feature is in beta.
- The right threshold differs per service, endpoint, or customer, and you group the alert by that dimension.
- Normal values drift over the day, so any fixed threshold is either noisy at peak or blind off-peak.
- You care about sudden changes, such as error spikes, latency jumps, or traffic that drops to zero, more than about absolute levels.
Supported alerts
Anomaly detection is a detection mode on an existing alert, not a separate alert type. It’s available on:- Search alerts, which score the count of matching events.
- Dashboard chart alerts on charts built with the chart builder.
Creating an anomaly alert
1
Open the alert editor
Open the alert editor for a saved search or a dashboard chart, as described in Alerts.
2
Select anomaly detection
Under Alert type, select Anomaly detection. The default is Static threshold.
3
Configure the condition
The condition reads as a sentence: Alert when z-score is at least
3 when value is outside expected range compared to the past 2 hours checked every 5 minute.- z-score is at least (default
3): how many standard deviations a value must be from the expected value to count as anomalous. The minimum is 0.5, and the arrows change it in steps of 0.5. Lower values are more sensitive and fire more often. - When value is (default
outside expected range): which direction to alert on:above expected,below expected, oroutside expected range. Useabove expectedfor error counts and latency, andbelow expectedfor throughput or sign-ups. - Compared to the past (default 2 hours): how much history ClickStack uses to measure normal variation: 30 minutes, or 1, 2, 4, 6, 12, or 24 hours. A longer baseline gives a more stable range but adapts more slowly to a new normal.
- Checked every (default 5 minutes): how often the alert is evaluated: 5, 15, or 30 minutes, or 1 hour. Shorter and longer intervals aren’t available for anomaly alerts.
4
Review the backtest and preview
The line under the summary is a backtest: it replays the current settings over recent history and reports how often the alert would have notified, for example “Would have notified 6 times in the past 24 hours, firing on 12 of 288 checks.” For search alerts, the backtest covers the last 24 hours. For dashboard chart alerts, it covers the chart’s selected time range, up to 24 hours. The count turns yellow when the alert would notify more than 10 times a day.The Anomaly detection chart below the form plots the same range:
- The solid line is the series.
- The dashed line is the expected baseline.
- The shaded area is the alert trigger zone. A value inside it, past the expected range, fires.
- Notify markers show where the alert would have sent a notification.
5
Choose a notification channel and save
Choose a webhook or other channel, as with any alert. See Adding a webhook. Save the alert to start evaluating it.
Suitability warnings
Some series are poor fits for anomaly detection. A warning appears under the preview chart before you save, but doesn’t block saving:How anomaly detection works
On every evaluation, ClickStack scores the evaluation window one bucket at a time. Buckets are 60 seconds long. For each bucket:- Expected value. ClickStack takes the moving average of the 7 buckets that ended one evaluation window earlier. Expected values are never negative.
- Spread. ClickStack computes the standard deviation of the series in ClickHouse, over the baseline you selected in Compared to the past. The baseline is never shorter than one evaluation window.
- z-score. The z-score is
(value − expected) / standard deviation. - Decision. The bucket fires when the z-score passes the configured threshold in the configured direction, and the value differs from the expected value by at least 5% of the expected value, or by 0.01 when the expected value is 0. The 5% floor stops near-constant series from firing on trivial wiggles.
expected ± z-score × standard deviation, widened by the 5% floor. In the preview, everything outside it is shaded as the alert trigger zone.
An evaluation window fires if any of its buckets fires.
Empty buckets
How ClickStack treats a minute with no data depends on the aggregation:- Counts and sums (including search alerts): an empty bucket is scored as zero. This means an alert with direction
below expectedoroutside expected rangefires when traffic stops entirely. - Averages, percentiles, minimum, maximum, ratios, and metric sources: an empty bucket means there was nothing to measure, so it’s skipped rather than scored as zero.
Grouped alerts
When an alert is grouped by a field, such asServiceName, each group is a separate series with its own expected range and alert state. ClickStack scores up to 100 series per alert, preferring the series with the most data. A series that is already alerting keeps being scored until it resolves, even if it falls out of the top 100.
Notifications and resolution
Anomaly alerts notify once per incident, per series:- When a series starts firing, ClickStack sends one notification and marks the series as alerting.
- While the series keeps firing on later evaluations, no further notifications are sent.
- When an evaluation window has no firing buckets, the series resolves and ClickStack sends a resolved notification.
- Title:
Alert for "Checkout errors" - value 142 is above the expected range (z-score 4.4) - Body:
Value 142 is above the expected range — z-score 4.4 vs sensitivity 3; expected 120 ± 5 (expected range 105 to 135).
{{anomaly.value}}, {{anomaly.expectedValue}}, {{anomaly.expectedStddev}}, {{anomaly.lowerBound}}, {{anomaly.upperBound}}, and {{anomaly.zScore}}. These values are only set on firing notifications. Resolved notifications don’t include them, so wrap them in {{#if anomaly}}...{{/if}} if the same name or message is used for both.
Monitoring anomaly alerts
On the Alerts page, set Filter by type to Anomaly to show only anomaly alerts. Each row describes the condition, for example “If value is above expected with z-score at least 3”. Select an alert to open its detail page. Below the condition summary, which includes the interval and baseline, ClickStack shows how often the alert fired over its retained history, for example “Fired 2 times in the past 2 days.” Select the range to show it in the chart and evaluation history. The Evaluation History table lists each check with its state, the latest value, and how many series were alerting. Rows with a notification duration sent a notification, both when the alert fired and when it resolved. If an alert stays in the alerting state for 20 or more consecutive windows, the detail page suggests that the series has a new normal rather than an anomaly. Raise the z-score, or update the alert so it compares against a more relevant baseline.Backtesting with MCP
With the ClickStack MCP server, an AI assistant can backtest anomaly settings before you save them. Theclickstack_backtest_anomaly_alert tool replays a configuration against up to 24 hours of history and reports, per series, the notifications it would have sent, along with data-quality warnings. The tool is read-only.
Tuning tips
- Alert is too noisy: raise the z-score in steps of 0.5, or change the direction from
outside expected rangeto the side you care about. - Alert missed a real incident: lower the z-score, or shorten the baseline so the range reflects recent behavior.
- Alert fires all day after a deploy: The series has a new normal, and longer baselines take more time to adapt than shorter ones.
- Low-volume series: group by fewer dimensions, or alert on a broader search, so each series has at least one event per minute.