Observability Wiki

Wiki hub

Continuous Profiling

Always-on, low-overhead sampling of exactly which code is consuming CPU, memory, or other resources in production.

Last updated

Continuous profiling samples what a program is actually doing — which function is on-CPU, which code path is allocating memory — at low overhead, all the time, in production. Instead of the one-off profiling sessions developers have historically run locally or in staging, continuous profilers run everywhere, always, and let you go back in time to see what the code was doing during any past incident.

The result is typically visualized as a flame graph: a stack of function calls where the width of each bar represents the proportion of time (or memory) spent in that function and everything it calls.

Why continuous profiling matters

  • It closes the last gap. Metrics, traces, and logs can tell you a service is slow and even which request is affected, but not which line of code is the bottleneck — profiling does.
  • It works in production, not just staging. Real production traffic, real data shapes, and real contention are often impossible to reproduce locally; continuous profiling captures the real thing.
  • It directly reduces infrastructure cost. Because profiling shows exactly which functions consume the most CPU or memory across a fleet, it’s one of the most direct tools for cutting compute spend.

Key concepts

  • Sampling profilers. Rather than instrumenting every function call (which would be far too expensive), continuous profilers sample the call stack many times per second, keeping overhead typically under 1-2%.
  • Flame graphs. The standard visualization for profile data — reading a flame graph means looking for the widest bars, which represent where the most time (or memory, or another resource) is actually being spent.
  • eBPF-based profiling. A newer generation of profilers (like Parca) use eBPF to capture profiles for any process on a Linux host without requiring code changes or per-language agents.
  • Correlating profiles with traces. The most powerful continuous profiling setups let you jump from a single slow trace span directly to the flame graph for that exact time window and service.

Where profiling fits with the other pillars

Metrics show a CPU or latency spike, traces show which service and which request, and logs explain business-level context — but only continuous profiling shows the actual function call responsible for burning CPU or allocating memory. It’s the pillar most directly tied to code, rather than to requests or infrastructure.

Articles in this hub

Popular profiling tools