RousselTMLEARNING

Article · Observability with eBPF: from discovery to expertise

Continuous profiling with eBPF

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.

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

My progress

  • ⏱ Estimated time : ≈ 4 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Profiles, OpenTelemetry's fourth signal: continuous profiling and correlation with traces

Understand OpenTelemetry's new profile signal: continuous profiling, flame graphs, data model and...

Continuous profiling with Grafana Pyroscope: why and how

The fourth signal of observability: what continuous profiling is, profile types (CPU, memory, loc...

Grafana Pyroscope best practices: collection, labels, analysis and costs

Production checklist for continuous profiling with Pyroscope: choosing the collection mode, label...

eBPF best practices for observability

Checklist for adopting eBPF in observability: choosing tools, gradual rollout, agent security, co...

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 ...

Instrumenting applications for Pyroscope: SDKs, Alloy and eBPF

Send profiles to Pyroscope from Go, Java, Python and Node.js with the SDKs, collect pprof endpoin...

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...

eBPF in production: security, prerequisites and limits

What to know before deploying eBPF agents: privileges and capabilities, kernel versions, managed ...

Analyzing profiles in Grafana: flame graphs, comparisons and diagnostics

A method for analyzing profiles in Grafana: Profiles Drilldown, flame graph and top table, compar...

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!