RousselTMLEARNING

Observability

Continuous profiling with eBPF: Parca, Pyroscope and the OpenTelemetry profiler

Continuously profile every process on a host with eBPF: principle, Parca and parca-agent, Pyroscope via Alloy, the OpenTelemetry eBPF profiler, symbols and supported languages.

1. The principle #

Sampling call stacks from the kernel.

How it works #

An eBPF program attached to a perf event (for example 19 times per second per CPU) reads the call stack of the running process, both kernel and user side, and aggregates it in a map. The agent periodically retrieves the aggregated stacks, symbolizes them and sends them to the server.

AdvantageLimit
No code changes, all processesMainly CPU profiles (no memory allocations)
Very low overheadRequires symbols (non-stripped binaries or debuginfo files)
Includes the kernelPrivileged agent on each node

2. The tools #

Three open source options.

Comparison #

ToolAgentStorage / interface
Parcaparca-agent (DaemonSet)Parca server, built-in interface (port 7070)
PyroscopeAlloy pyroscope.ebpfPyroscope + Grafana (see the Pyroscope course)
OpenTelemetry eBPF profilerAgent donated by Elastic, integrated into the CollectorAny backend accepting OTLP profiles

Parca with Docker #

docker network create prof
docker run -d --name parca --network prof -p 7070:7070 ghcr.io/parca-dev/parca:latest /parca
docker run -d --name parca-agent --network prof --privileged --pid host \
  -v /sys/kernel/debug:/sys/kernel/debug -v /lib/modules:/lib/modules:ro \
  ghcr.io/parca-dev/parca-agent:latest \
  --remote-store-address=parca:7070 --remote-store-insecure

The interface (http://localhost:7070) shows CPU profiles for all processes, filterable by labels (comm, container, pod).

Good to know: The agent's exact options change between versions: check the parca-agent README if an option is rejected.

3. Symbols #

Function names rather than addresses.

Symbolizing properly #

  • Go, Rust, C/C++: keep the symbol tables (no strip, no -ldflags="-s -w") or publish the debuginfo files.
  • Java, Node.js, Python: recent agents can unwind the stacks of these runtimes; check the list of runtimes supported by your agent.
  • Parca can fetch symbols from a debuginfod server for distribution packages.

Related articles

eBPF explained: programs in the Linux kernel to observe without instrumenting

What eBPF is, how a program is verified and then run in the kernel, hook points (kprobes, uprobes, tracepoint…

Diagnosing with bpftrace and the bcc tools

Everyday eBPF diagnostic tools: bpftrace one-liners (system calls, files, latencies), bcc tools (execsnoop, o…

Zero-code instrumentation with Grafana Beyla (OpenTelemetry eBPF Instrumentation)

Get RED metrics and HTTP/gRPC traces from any application without changing it: Grafana Beyla and OpenTelemetr…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!