RousselTMLEARNING

Article · Observability with eBPF: from discovery to expertise

Continuous profiling with eBPF

This article is available in French.

1. Le principe #

Échantillonner les piles d'appels depuis le noyau.

Comment ça marche #

Un programme eBPF attaché à un perf event (par exemple 19 fois par seconde par CPU) lit la pile d'appels du processus en cours, côté noyau et côté utilisateur, et l'agrège dans une map. L'agent remonte périodiquement les piles agrégées, les symbolise et les envoie au serveur.

AvantageLimite
Aucune modification du code, tous les processusProfils CPU surtout (pas d'allocations mémoire)
Surcoût très faibleBesoin des symboles (binaires non « strippés » ou fichiers debuginfo)
Inclut le noyauAgent privilégié sur chaque nœud

2. Les outils #

Trois options open source.

Comparatif #

OutilAgentStockage / interface
Parcaparca-agent (DaemonSet)Serveur Parca, interface intégrée (port 7070)
PyroscopeAlloy pyroscope.ebpfPyroscope + Grafana (voir la formation Pyroscope)
Profiler eBPF OpenTelemetryAgent donné par Elastic, intégré au CollectorTout backend acceptant les profils OTLP

Parca avec 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

L'interface (http://localhost:7070) affiche les profils CPU de tous les processus, filtrables par labels (comm, conteneur, pod).

À savoir : Les options exactes de l'agent évoluent selon les versions : consultez le README de parca-agent si une option est refusée.

3. Les symboles #

Des noms de fonctions plutôt que des adresses.

Bien symboliser #

  • Go, Rust, C/C++ : gardez les tables de symboles (pas de strip, pas de -ldflags="-s -w") ou publiez les fichiers debuginfo.
  • Java, Node.js, Python : les agents récents savent dérouler les piles de ces environnements ; vérifiez la liste des runtimes pris en charge par votre agent.
  • Parca peut récupérer les symboles depuis un serveur debuginfod pour les paquets des distributions.

📄 Profiling continu avec eBPF : Parca, Pyroscope et le profiler OpenTelemetry →

My progress

  • ⏱ Estimated time : ≈ 4 min

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

✉️ Ask a question

Recommended Articles

Understanding the concept of score

The concept of score allows Elasticsearch to rank your documents by relevance during a search.

Understanding the Elastic Common Schema (ECS)

As always in our consulting engagements, we recommend that companies harmonise and standardise: k...

License consumption types

Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...

Grafana Alloy: The importance of Self-Monitoring

Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...

Grafana Alloy: Understanding and exploiting the User Interface (UI)

Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...

Grafana Alloy: Introduction and Architecture

Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...

Grafana Alloy: Syntax and Configuration (Alloy Language: River)

As part of a Grafana training or observability training, master the declarative syntax of Grafana...

Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)

Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...

Grafana Alloy: Log Management with Loki

Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...