Insights

Does APM monitoring slow down your application?

QuestionPerformance and capacity

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:

  1. 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.
  2. 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.
  3. 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.
  4. Repeat both runs. A single pass is noise.
  5. 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:

  1. Map the main transaction types.
  2. Fix the reporting format if needed, so that all the metrics above are kept as time series.
  3. Run a baseline without the agent, with ramp-up and steady state.
  4. Repeat it with the agent, documenting sampling and trace coverage.
  5. 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:

  1. 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.
  2. The difference is stable across repeated runs, viewed as time series and percentiles, not only as averages.
  3. 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.

Insights

APM overhead: questions and answers

Does an APM agent slow down my application?

Yes, in the sense that any instrumentation uses CPU, memory, latency budget, startup time and network bandwidth. Whether that cost matters for your journey depends on configuration and workload. The rollout question is not whether the cost is zero. It is whether you measured it fairly.

What is APM agent overhead?

APM agent overhead is the extra work the instrumentation adds on the application host: capturing spans and metrics, buffering them, serialising them, and sending them to the backend. The same word covers the latency you might see on a request path and the background CPU the reporter thread uses.

What does agent overhead consist of?

CPU for capture and export, memory for buffers and object pools, latency on the request path when capture is not fully asynchronous, longer startup while the agent attaches and warms up, and network and ingest volume for traces, logs and metrics. A load test that watches only host CPU misses most of that split.

Can I trust a vendor's published overhead figure?

Treat vendor benchmarks as that vendor's claim on that hardware and configuration, not as your result. No single overhead figure fits every deployment. Run your own with-and-without comparison in an environment that matches production, and treat a headline number as less useful than the method behind it.

Why do short load spikes give the wrong overhead answer?

A quiet-system spike is not the steady peak you will run in production. Adaptive trace sampling, such as Dynatrace Adaptive Traffic Management, lowers the capture rate when ingest exceeds the licensed volume, so a few minutes of spike may not show the sampling state of sustained traffic. That distorts application numbers and any attempt to subtract agent cost.

How do you compare with and without the agent fairly?

Use the same environment, scenario and load tool. Ramp up, hold a steady state long enough for sampling and caches to settle, then ramp down. Record response time, error rate, CPU, memory, I/O and queue depth as time series, not one average. Repeat the run with the agent off, then on, and document agent version, sampling and capture settings.

Which settings increase agent overhead the most?

Deep code-level capture, full trace sampling, large span volume, stack traces on every span, heavy log and request-body capture, and many enabled instrumentations all increase cost. Elastic's Java agent tuning guide ties overhead to sampling, stack-trace collection and optional header capture. Turn down what you do not need before you argue about rollout.

Does OpenTelemetry overhead differ from Dynatrace OneAgent or Datadog APM?

The mechanism is the same class of work; products differ in defaults, sampling, auto-instrumentation breadth and export path. Comparing brands from a blog table is not a fair test. Compare with and without the agent you plan to run, on your journey, with your settings.

When is the overhead small enough to accept rollout?

When the with-agent run still meets the limit you would defend for the critical journey at the load shape you expect, and the delta you measured is stable across repeated runs. If the test had no steady state or no multi-dimensional metrics, the decision is not ready. Peak-load method is on will your system handle peak load.

Is slow performance with healthy servers the same as agent overhead?

No. A journey can wait on a dependency while host charts stay calm; that diagnosis is on why the application is slow when the servers look fine. Agent overhead is the incremental cost of instrumentation on top of the same journey. Measure both, do not confuse them.

What does Review and improve cover for agent overhead?

It reviews whether existing performance tests and monitoring settings produce evidence you can act on: scenario, steady state, metrics kept, and agent configuration written down. It does not publish an overhead percentage for your estate. The decision on rollout stays with you.

Discuss your situation

Top