examples/otel-collector/ebpf/README.md
This example demonstrates system-wide continuous profiling using the OpenTelemetry eBPF profiler, with profiles exported to Pyroscope and visualized in Grafana.
Linux only (amd64/arm64). The eBPF profiler requires the Linux kernel and privileged access to system resources (/proc, /sys/kernel, cgroups).
flowchart LR
A["OTel eBPF Profiler
<i>collects CPU profiles
system-wide via eBPF</i>"] -- "OTLP gRPC" --> B["Pyroscope
<i>stores & aggregates
profiling data</i>"]
B -- query --> C["Grafana
<i>visualize as
flamegraphs</i>"]
The profiler runs with host PID namespace access and collects CPU profiles at 97 samples/second from all processes on the host. Profiles are sent to Pyroscope via OTLP gRPC, where process.executable.name is relabeled to service_name.
cd docker
docker compose up
Services:
To stop:
docker compose down
kubectl with kustomize supportkubectl apply -k kubernetes/
This deploys:
kubectl port-forward svc/grafana 3000:3000
Then open http://localhost:3000.
kubectl delete -k kubernetes/
| File | Description |
|---|---|
docker/config/ebpf-profiler-config.yaml | OTel Collector config for Docker (profiling receiver, OTLP exporter) |
docker/config/pyroscope.yaml | Pyroscope config with process.executable.name -> service_name relabeling |
kubernetes/config/ebpf-profiler-config.yaml | OTel Collector config for Kubernetes (adds k8sattributes processor for pod metadata) |