Insights
Does APM monitoring slow down your application?
Yes, every APM agent has a cost: CPU, memory, some latency, startup time and network traffic for the telemetry it sends. Whether that cost matters depends on the configuration, the workload and how you measure it. Before a rollout, the bigger risk is usually not the agent itself, but a misleading measurement: a short spike test, adaptive sampling that never had time to settle, or a report with too few metrics.
01
What does agent overhead consist of?
An APM agent runs inside or next to your application process. It watches calls, builds spans and traces, attaches context, and sends the telemetry to a backend. This work shows up in several places at once:
- CPU on the application host, including the background threads that serialise and send the data.
- Memory for buffers, queues and the short-lived objects created for each request.
- Latency on the request path, when capture is not fully asynchronous, or when locks and allocation spikes coincide with slow requests.
- Startup time while the agent attaches, classes load and just-in-time compilation settles.
- Network and ingest volume for the traces, metrics and logs you chose to keep.
Agent overhead = capture on the request path
+ background export (CPU and memory)
+ startup and attach cost
+ configured ingest volume
Fair measurement = same scenario, agent off then on,
ramp-up + steady state + time-series metrics + documented settings
- Agent overhead
- The additional resource use and latency caused by APM instrumentation on the host that runs the journey, compared with the same journey and settings without it.
- Instrumentation
- Code or an agent that records spans, metrics or logs about the journey. Both broad auto-instrumentation and manual spans add volume.
- Steady state
- The part of a load test where arrival rate and concurrency stay at the planned peak long enough for caches, pools and adaptive sampling to stop changing.
- Adaptive sampling
- A trace capture rate that changes with traffic or ingest limits. A test that never reaches production-like traffic may never reach production-like sampling.
- Time-series metrics
- CPU, memory, response time, error rate, I/O and queue depth plotted over the whole run, not a single average at the end.
A host chart alone cannot separate application time from agent time. If the journey is slow while that chart stays calm, find the wait first: see why the application is slow when the servers look fine. This page is about the additional cost of the agent, measured in a way you can trust.
02
Which settings increase overhead the most?
The defaults are not neutral: they decide how much telemetry is produced. The main levers:
- Sampling rate and span volume. These are the biggest factors. Elastic's overhead and performance tuning guide for its Java agent ties CPU, memory, network and latency to the sample rate, stack-trace collection and optional header capture.
- Breadth of auto-instrumentation. OpenTelemetry lets you switch off instrumentations you do not need; Dynatrace and Datadog offer similar choices in their settings.
- Deep capture on hot paths. Code-level sensors, method-level tracing and heavy log correlation all increase the work done per request.
- Export pressure. When the backend or collector is slow, the agent buffers more. Datadog's Agent resource usage by APM describes the trace agent as CPU-bound with memory buffering, and uses spans received per second for sizing. That is a sizing method, not a promise for your service.
Reduce capture to what the journey actually needs before you debate whether the rollout is safe.
03
Why do short spike tests give the wrong overhead figure?
Because they measure a situation that does not occur in production. Architects often ask for a quick comparison: agent on for five minutes, agent off for five minutes, compare CPU. But production traffic builds up and holds; it rarely arrives as a sudden spike on an idle system. A short spike distorts the result in two ways:
- Sampling has no time to settle. Adaptive sampling reacts to volume. The Dynatrace Adaptive Traffic Management documentation describes sampling that adjusts to keep ingest within the licensed trace volume: at low traffic capture can stay near 100%, and when ingest exceeds the allocated volume the sampling rate drops. The documentation does not say how quickly this settles, so a short spike may never show the sampling state you will live with in production.
- The application is not warmed up. Pools, caches and compilation need time. The OpenTelemetry Java agent performance guide recommends warming the journey up before measuring and repeating the runs with realistic error rates. Without this, you may compare cold code with a warm agent, or the other way round.
A spike test measures the spike. It does not measure the peak you will have to defend.
Why the shape of the load matters, with ramp-up and steady state, is explained in will your system handle peak load. This page adds the agent as one more variable that must be held constant between runs.
04
How do you compare with and without the agent fairly?
Treat overhead as a measurement task, not as a debate. The steps:
- Choose one critical journey and a realistic scenario: the mix of transaction types, the concurrency and the length of the busy period, as they happen in production. Define this before you tune any agent setting.
- Run a baseline without the agent. Ramp up gradually, hold a steady state long enough for the journey and the runtime to settle, then ramp down. Record response time, error rate, CPU, memory, disk I/O, queue depth and anything else you already use in capacity reviews, as time series in one place.
- Run the same test with the agent on: the same parameters, environment and software versions. Document the agent version, sampling rate, trace capture rules, enabled instrumentations, and whether log or request-body capture is on. Record the same metrics, plus what the backend shows about sampling and ingest.
- Repeat both runs. A single pass is noise.
- Compare like with like. Same machine size, same data, same behaviour of the dependencies. Only the agent changes; everything else is documented.
The OpenTelemetry guidelines for measuring agent overhead describe the same approach: decide what matters to your users, use a production-like environment and realistic workload with warm-up, change one factor at a time, and compare the results with plots or statistical tests. For a service that is already live, the same discipline applies before you trust a number: see performance tests that do not yet answer the busy period.
05
Example: one integration platform before rollout
The example is illustrative. A team plans to enable a full-stack APM agent on an integration platform before the busy season. The critical journey is an order-status query that passes through the integration layer.
| Input | Value |
|---|---|
| Critical journey | Order-status query through the integration layer |
| Planned peak | A steady arrival rate held for 45 minutes |
| Limit they would defend | At least 95% of attempts finish within the agreed latency, and fewer than 1% fail |
| The test they almost ran | A five-minute spike on an idle system, measuring CPU only |
| The fair comparison | Ramp-up, at least 30 minutes of steady state at the planned peak, the same scenario with the agent off and then on, response time and error rate plus CPU, memory and I/O as time series |
The five-minute spike would have mixed a cold start with adaptive sampling that was still changing, and would have said nothing about the journey's limit. The paired steady-state runs answer the rollout question: does the journey still meet its limit with the agent on, and is the difference stable?
06
A typical case: the spike test on the integration platform
The mistakes above often appear together. A common picture in performance-test reviews of enterprise integration platforms with an APM agent: the existing tests use short load bursts against an otherwise quiet system, with no gradual ramp-up and no sustained steady state, so adaptive sampling never behaves as it would under production traffic. Metrics coverage is thin: there are some throughput and CPU figures, but no multi-dimensional report with response time, error rate, memory, I/O and queue behaviour over time.
The way forward is a sequence, not a single number:
- Map the main transaction types.
- Fix the reporting format if needed, so that all the metrics above are kept as time series.
- Run a baseline without the agent, with ramp-up and steady state.
- Repeat it with the agent, documenting sampling and trace coverage.
- Run a longer soak test with the agent before any stress scenario.
07
Conclusion
An APM agent does slow the application down; the real question is by how much, and that is a measurement, not a debate. A short spike test cannot provide it, because it measures a cold system and a sampling state that production never sees. So decide on the rollout from a paired steady-state comparison on a critical journey, after reducing capture to what the journey needs. The evidence is enough when three conditions hold:
- The journey meets its limit with the agent on, at the expected load shape, using the same definition of success as your peak-load plan.
- The difference is stable across repeated runs, viewed as time series and percentiles, not only as averages.
- The method is documented: scenario, ramp-up, steady-state duration, metrics kept, agent settings and sampling behaviour during the steady state.
If any of these is missing, the honest answer is that the overhead is still unknown. That is not a permanent blocker for the rollout, only for a numeric claim. Stress, failover and soak tests come after a credible pair of baseline runs: the soak test shows memory and sampling drift over a long hold, and spike tests make sense once you know the steady peak is safe.
If the same portfolio already has monitoring tools but nobody can say what they cover, that is a separate question: see where the gaps in your monitoring are.
Review and improve checks whether your existing performance tests and agent settings produce evidence you can act on: the scenario, the steady state, the metrics kept and the documented agent configuration. It does not publish an overhead percentage; the rollout decision stays with you. Walk one journey and your test method through with us.
