Anomaly detection in monitoring is the automatic identification of metrics that behave differently from their own normal behavior. In IT infrastructure and operations it runs on time series such as CPU, memory, disk latency, network errors, queue depth, request rate and response time, and it finds what changed in servers, containers, databases, networks and applications without a person defining every limit in advance.
This guide is for SREs, DevOps and platform engineers, and operations teams. It explains the methods used on infrastructure metrics, what anomaly detection needs before a whole fleet can trust it, and the use that pays off during incidents: anomalies on every metric as the evidence for root cause analysis. Fraud, finance and security teams use the same term for other problems. They are outside this page.
In short:
- Four families of methods are used in monitoring: static thresholds, statistical baselines, seasonal models and unsupervised machine learning. Each one fails in a different way.
- An anomaly is a fact about a metric. One anomaly says little. Clusters of anomalies across components in the same seconds show what an incident touched, and in what order.
- Anomaly detection is strongest as evidence: on every metric, with nothing to configure, stored with the data. Then any incident window can answer “what was abnormal here, and in what order?”
- Netdata is built this way. It trains machine learning models for every metric, stores the verdict with every sample, and ranks every metric for any time window, so root cause analysis starts from the evidence and not from a guess.
What is anomaly detection in monitoring?
Monitoring collects numbers over time. Anomaly detection decides, for each new number, whether the history of that metric explains it.
Every method has the same three parts:
- A model of normal. It can be a fixed limit, an average with a tolerance band, a forecast that knows the time of day, or a machine learning model trained on recent data.
- A score. Each new sample is compared with the model. The result says how far the sample is from normal.
- A decision. A cutoff turns the score into a verdict: normal or anomalous.
What are the three types of anomalies in metrics?
| Type | What it looks like | Infrastructure example |
|---|---|---|
| Point anomaly | One sample far from all the others | Response time jumps from 40 ms to 4 seconds for one second |
| Contextual anomaly | A value that is normal in general, but not at this time or in this state | 80% CPU at 03:00 on a server that is idle every night |
| Collective anomaly | A run of samples that are each plausible, but unusual together | Memory grows by a small step every minute for an hour; a counter that always moves goes flat |
Point anomalies are the easy ones. Most real incidents are contextual or collective, and they are spread across many metrics at once.
How does anomaly detection work on time series?
Infrastructure metrics are time series: one value per metric per collection interval. Four properties of time series decide whether a method works.
- Level and trend. A disk fills slowly. A queue grows with the business. A model with a fixed idea of normal becomes wrong as the level moves.
- Seasonality. Traffic follows the day and the week. Backups run at night. Billing runs at the end of the month. A value that is normal at noon is abnormal at midnight.
- Bursts. Deployments, batch jobs, cache warm-ups, garbage collection and autoscaling all produce short, sharp, harmless changes.
- Resolution. A 20-second saturation is obvious in per-second data. In a one-minute average it becomes a small bump or disappears. Many products described as “real-time” collect every 10 to 60 seconds, so short anomalies never reach the detector at all.
Which anomaly detection methods are used in monitoring?
Static thresholds
A fixed limit: disk usage above 90%, more than 100 errors per minute, replication lag over 30 seconds. Static thresholds are the oldest form of anomaly detection, and they are still the right tool when the limit is a fact, not an estimate. A full disk is a full disk on every server.
They fail when normal is different per system or per hour. A CPU threshold that suits a batch server pages constantly on a build server and never on an idle one.
Statistical baselines
The model is a summary of recent values, and the tolerance is expressed in spread.
- Z-score. How many standard deviations a sample is from the mean. If response time averages 120 ms with a standard deviation of 15 ms, a 210 ms sample has a z-score of 6, far outside the usual cutoff of 3.
- Median and median absolute deviation, or the interquartile range. Like the z-score, but not distorted by the spikes they try to find.
- Distribution tests. The Kolmogorov-Smirnov test compares the shape of two periods and says whether the metric behaves differently now than before, even when no single sample is extreme.
Statistical baselines are light, transparent and repeatable. They assume that the metric has one normal level. Bursty metrics and metrics with a daily cycle break that assumption.
Seasonal and forecasting models
The model predicts the next value from the pattern of previous days and weeks, and flags samples that fall outside the prediction band. Holt-Winters smoothing, seasonal ARIMA, seasonal decomposition and Prophet belong here.
They handle daily and weekly cycles well. They need weeks of history, the right season length, and they are thrown off by holidays, incidents inside the training data and any change of schedule.
Unsupervised machine learning
The model learns the shape of normal behavior from the data itself, with no labels. Common algorithms are k-means clustering, Isolation Forest, Local Outlier Factor, one-class SVM, random cut forest and autoencoders. Instead of looking at one value, they usually look at a short pattern of recent values, so they catch collective anomalies that a z-score misses.
They need no description of the metric and no manual limits. The cost is compute, and a single model has blind spots that depend on what its training window contained.
Supervised learning, trained on labeled examples of failures, is rare in infrastructure monitoring: nobody has a labeled history of every failure, and the next incident is usually a new one.
How do the methods compare?
| Method | How it decides | Works well for | Where it fails | What you maintain |
|---|---|---|---|---|
| Static threshold | Value crosses a fixed limit | Hard limits: disk full, certificate expiry, service objectives | Anything whose normal differs per system or per hour | Every limit, per metric and per class of system |
| Statistical baseline | Distance from a recent average or median, in units of spread | Stable metrics with one normal level | Bursty and seasonal metrics; slow trends | Window length and sensitivity per metric |
| Seasonal or forecasting model | Distance from a forecast that knows the cycle | Traffic and business metrics with clean daily or weekly cycles | Changing schedules, holidays, short history | Season length, retraining, exclusions |
| Unsupervised machine learning | Distance from learned patterns of recent behavior | Every kind of metric, including ones nobody has looked at | A single model has blind spots from its training window | Nothing, when it trains by itself; otherwise model selection and retraining |
Static thresholds or anomaly detection: which should you use?
Both, for different jobs.
- Use thresholds and rules for conditions someone can state in advance: the disk is filling, the service does not answer, the error rate breaks the service objective. Rules are readable, testable and easy to reason about at 3am.
- Use anomaly detection for everything nobody stated in advance. Most incidents are not caused by what someone wrote a check for.
Why is anomaly detection hard to trust at scale?
Engineers who tried it describe the same experience: it fires on every batch job and traffic peak, and after months of tuning the team stops looking at it. There are four reasons.
1. The arithmetic of false positives. A detector that is wrong once in a thousand samples sounds accurate. Apply it to a real fleet:
| Fleet | Samples per day | False flags per day at 0.1% |
|---|---|---|
| 200 servers, 2,000 metrics each, one sample per minute | 576 million | 576,000 |
| The same fleet, one sample per second | 34.6 billion | 34.6 million |
Nobody can read that. So products watch only a few chosen metrics, average over long windows and raise the cutoff. Each step removes false positives and real signals together.
2. Bursty and seasonal workloads. A deployment, a nightly backup, a cache flush and an end-of-month job are all anomalies by any statistical definition. They are also the most ordinary events in operations.
3. Tuning that never ends. Sensitivity per metric, training periods, excluded windows, retraining after each change. The work grows with the number of metrics, so teams apply it to a short list, and incidents happen in the metrics that were left out.
4. An anomaly is not a problem. “Unusual” and “bad” are different properties. A deployment is unusual and harmless. A disk that has been filling at the same pace for three weeks is usual and harmful. Finding a problem takes more than one anomaly: it takes knowing what else was abnormal in the same seconds.
Anomaly detection earns its place when it is accurate on every metric and its verdicts are kept.
What is anomaly detection good for? Evidence for root cause analysis
Record every anomaly, on every metric, and ask the record when someone needs an answer: “an alert fired at 14:02, what was abnormal around that time, where, and in what order?”
Used this way, three things matter:
- Clusters, not single flags. Isolated flags are scattered across metrics and time. Real incidents look different: many metrics, across several components, turn anomalous in the same seconds.
- Bursts become context. The backup that ran at 02:00 is in the record. If the incident started at 02:01, that is the first thing an investigator wants to see.
- Nobody chooses what to watch. The metric that explains the next incident is one that nobody thought about. It only helps if it was scored anyway.
Three conditions make this work, and they are worth checking in any product:
- Every metric is scored, not a selected list.
- Nothing is configured. Models train and retrain by themselves, or the coverage will not last.
- The verdict is stored with the data. The record must say what was detectable at that moment, for as long as the data is kept, so that an incident from last Tuesday can be investigated today.
How does Netdata do anomaly detection?
Netdata uses machine learning to model the behavior of the infrastructure and applications. Clusters of anomalies reveal dependencies that would otherwise go unnoticed, show how problems cascade across systems, networks and applications, can identify issues before they become outages, steer root cause analysis with data, and surface the actual impact of failures.
This is how it is built:
- Models for every metric, trained where the data is. Netdata applies unsupervised machine learning (k-means) to every metric it collects, on the Agents and Parents that hold the data. Each metric is modeled on its own recent behavior. There are no labels, no thresholds and nothing to configure, and detection scales with the fleet because every node does its own share.
- 18 models per metric, with consensus. Each model is trained on 6 hours of data and a new one is trained every 3 hours, so the 18 models cover about the last 54 hours. A sample is flagged anomalous only when all 18 agree. Behavior that repeats every day, such as a nightly backup, has been seen by the models and is treated as normal. It still appears in the ranked list when it changed against the period before the window, anomalous or not.
- About 99% of false positives removed. Consensus removes about 99% of false positives. The theoretical false-positive rate is 10⁻³⁶ per metric: the chance that 18 models, each wrong on one sample in a hundred, agree by accident. An anomaly flag in Netdata means that 54 hours of that metric’s history cannot explain the sample.
- The verdict is stored with every sample. The anomaly flag is part of the sample in the database. It has the same retention as the data, it is immutable, and it records what was detectable at that moment.
- Anomaly rates everywhere. Because the verdict is data, Netdata computes an anomaly rate for any metric, chart, instance or node, for any time window. The node anomaly rate is the share of a node’s metrics that are anomalous at the same time. Even 1% is a strong signal: on a node with 5,000 metrics it means about 50 metrics, each past an 18-model consensus, at once.
- The scoring engine. For any time window, Netdata scores every metric across the stack by how anomalous it was, by how much it changed against the period before, and by what changed together with it. It returns a ranked list. Of millions of metrics, only a few hundred show synchronized anomalies in the same seconds, so Netdata drills down to them instantly, however large the infrastructure is. In the Anomaly Advisor, the root cause is usually among the top 30 to 50 results.
- AI that starts from the evidence. Netdata AI receives the few hundred metrics that were anomalous or changed during the window, as context, and reasons over them. It does not have to guess where to look, and nobody has to tell it how your services work.
You can install Netdata in the middle of a crisis and get real-time insights and AI-assisted troubleshooting immediately. Anomaly scores follow after about 15 minutes, when the first models are trained. The anomaly detection feature page has the details.
Can you alert on anomalies with Netdata?
Yes. In Netdata, alerting stays with rules that people can read and reason about, and anomaly rates are data like any other, so a team can use them in a rule where it chooses to. This is a rule on the anomaly rate of the CPU chart over the last 5 minutes:
template: ml_5min_cpu_chart
on: system.cpu
lookup: average -5m anomaly-bit of *
calc: $this
units: %
every: 30s
warn: $this > (($status >= $WARNING) ? (5) : (20))
crit: $this >= (($status == $CRITICAL) ? (20) : (100))
info: rolling 5min anomaly rate for system.cpu chart
It reads like any other Netdata alert: a lookup, a warning condition, a critical condition, and hysteresis so that it does not flap. The same pattern works on any metric, and on the node anomaly rate. You decide where such a rule belongs. Machine learning does not change the state of any alert on its own.
So Netdata gives you both uses: the anomaly record for every metric from the start, and anomaly-rate alerts as ordinary rules. A stock rule already watches the node anomaly rate (above 1%, shown on the dashboard, silent by default), and you add your own on any metric.
What is an example of anomaly detection in monitoring?
This incident is illustrative. An API latency alert fires at 02:14. It is a plain threshold on the 95th percentile. The on-call engineer has the alert and nothing else: no deployment happened, and CPU on the API nodes is normal.
The speculative way to investigate is to form a theory (the database, probably), open its dashboards, and try to prove or drop it.
The evidence-first way starts from the anomaly record of the minutes before 02:14. The ranked list reads:
| Time | What turned anomalous | Where |
|---|---|---|
| 02:01:10 | Disk read operations and I/O wait of one process group | The backup job on the primary database host |
| 02:01:40 | Disk latency and queue length | The same host’s data volume |
| 02:03 | Query duration, active connections | The database |
| 02:06 | Connection pool wait time, thread count | Three API nodes |
| 02:11 | Request latency, then the alert at 02:14 | The API |
Nobody chose these metrics, and only the last one had a threshold. The order tells the story: the backup ran on the primary instead of the replica, storage latency rose, queries slowed, pools filled, the API slowed. The cause is the backup job and what it did.
With Netdata the engineer does not assemble this table by hand. One click on the alert starts Netdata AI, which asks the scoring engine for this evidence and writes the report in about two minutes: the cause and everything it affected.
What does this change for you?
Netdata finds the root cause: the application responsible, what it did, and everything it affected.
Every metric is scored every second, before anything goes wrong. When something does, the evidence is already there: which metrics stopped behaving like themselves, where, and in what order. The root cause is read from that record. Nobody opens twelve dashboards at 3 a.m. to guess which chart matters.
It tells noise from an incident. Alerts and scattered anomalies are noise. An incident is many metrics, across several components, turning anomalous in the same seconds. Netdata says which one you are looking at.
It finds the incidents no alert rule anticipated. Nobody chose what to watch, so nothing was left out. The metric that explains the next incident is already scored.
Stop guessing. Every engineer gets the answer, not only the one who knows the system, and the evidence is on the screen for everyone to check. It works on day one, on one node or 100,000+: nothing to write, map, tag, instrument or maintain.
How do you evaluate anomaly detection in a monitoring tool?
These questions show whether anomaly detection will help you during an incident.
| Question | What to look for | What Netdata does |
|---|---|---|
| Which metrics are scored? | All of them. The next cause is in a metric nobody selected | Every metric it collects, including Prometheus and OpenTelemetry metrics |
| Who configures and tunes it? | Nobody, or coverage shrinks to a short list | Models train and retrain by themselves |
| At what resolution? | Every sample. Short anomalies vanish in averages | Every sample, as it is collected; per-second for system metrics |
| Is the verdict stored? | Yes, so past incidents can be investigated | With every sample, for the full retention of the data |
| What do you get after detection? | An answer, not a list of anomalies | A ranked list for any window, the order of the cascade, and an AI report from that evidence |
| Can your own AI use it? | Yes, through an open protocol | Claude, ChatGPT or Cursor ask Netdata what was anomalous and what changed during any alert |
FAQ
Is anomaly detection the same as alerting?
No. Alerting tests conditions someone defined in advance and notifies a person. Anomaly detection marks behavior that a metric’s own history does not explain. An alert tells you that something is wrong. The anomaly record tells you what else was unusual at the same time, which is how you find out why.
Which algorithm is best for anomaly detection on infrastructure metrics?
No single algorithm wins on every metric. What matters more is coverage and agreement: scoring every metric, at full resolution, and requiring several independently trained models to agree before a sample is flagged. Netdata uses 18 k-means models per metric and flags a sample only when all of them agree.
How long does anomaly detection need before it works?
A statistical baseline needs minutes to hours. Seasonal models need weeks. In Netdata, a new metric gets its first model, and its first anomaly scores, after about 15 minutes of data. All 18 models are in place after about 54 hours.
How does AI use anomaly detection?
A large language model cannot read millions of time series, and it should not guess which ones matter. Anomaly detection on every metric solves that. Netdata’s scoring engine ranks every metric for the window in question and gives the AI the few hundred that were anomalous or changed. The AI starts with the evidence, and you can see the same evidence it saw.
What is the difference between anomaly detection and root cause analysis?
Anomaly detection says which metrics behaved unusually and when. Root cause analysis explains why the incident happened. The first is the evidence for the second. Evidence-first root cause analysis means starting from what the data says, across every metric, before anyone forms a theory. See root cause analysis with Netdata, and the guides on alert and incident triage and dependency mapping.
How do you start an investigation from the anomaly record?
Detection runs continuously, so the record is always there. The scoring engine also finds the interesting time windows on its own, for example “the most intense events across my systems and applications last week”. You start an investigation with one click on an alert, a question in plain language, a time window selected in the Anomalies tab, or a schedule (daily, weekly or monthly). Teams that want investigations running on their own can talk to us about AI SRE.
See what your data says
Every other investigation starts with a guess. Netdata starts with the evidence. Netdata is open source, and a Netdata Cloud trial is all it takes to run evidence-first root cause analysis on your own systems. Start a trial, or book a demo and bring your hardest incident.








