RousselTMLEARNING

Article · Observability with eBPF: from discovery to expertise

eBPF explained

This article is available in French.

1. eBPF en quelques mots #

Une machine virtuelle dans le noyau.

Le principe #

Fonctionnement d'eBPF
Le vérificateur garantit que le programme ne peut ni planter ni bloquer le noyau.

eBPF (extended Berkeley Packet Filter) permet de charger de petits programmes dans le noyau Linux, sans module ni redémarrage. Avant d'être exécuté, chaque programme passe par un vérificateur (pas de boucle infinie, pas d'accès mémoire hors limites), puis il est compilé en code natif (JIT) et attaché à un événement.

Pour l'observabilité, cela signifie : voir chaque appel système, chaque paquet, chaque fonction d'un processus, avec un surcoût très faible et sans modifier les applications.

2. Les points d'accroche #

Où un programme peut s'attacher.

Types de hooks #

HookDéclenché parExemple d'usage
tracepointPoint d'instrumentation stable du noyauAppels système, ordonnanceur, réseau
kprobe / kretprobeEntrée / sortie d'une fonction du noyauLatence de vfs_read
uprobe / uretprobeEntrée / sortie d'une fonction d'un programmeSSL_write d'OpenSSL : voir le HTTP avant chiffrement
perf eventMinuterie ou compteur matérielProfiling CPU par échantillonnage
XDP / TCPaquet réseau (avant ou dans la pile)Filtrage, répartition de charge, flux réseau
LSMContrôles de sécuritéDétection d'exécutions suspectes
À savoir : Les tracepoints sont stables entre versions du noyau ; les kprobes dépendent des fonctions internes et peuvent casser lors d'une mise à jour.

3. Maps, BTF et CO-RE #

Échanger des données et rester portable.

Les maps #

Un programme eBPF ne fait pas d'entrées-sorties : il écrit dans des maps (tables de hachage, tableaux, ring buffers) que l'agent en espace utilisateur lit. On agrège donc dans le noyau (compteurs, histogrammes) et seul le résultat remonte : c'est ce qui rend eBPF si économe.

Portabilité #

BTF (BPF Type Format) décrit les structures du noyau courant ; CO-RE (Compile Once, Run Everywhere) ajuste le programme à la volée. Un même binaire fonctionne ainsi sur plusieurs versions du noyau.

uname -r                                   # 5.8+ recommandé, 5.15+ idéal
ls /sys/kernel/btf/vmlinux                 # BTF disponible ?
bpftool feature probe | grep -i "map_type" | head
OutilCatégorie
bpftrace, bccDiagnostic ponctuel en ligne de commande
Grafana Beyla / OpenTelemetry eBPF InstrumentationMétriques RED et traces des applications
Cilium HubbleFlux réseau Kubernetes
Pyroscope, Parca, profiler eBPF OpenTelemetryProfiling continu
Tetragon, FalcoObservabilité de sécurité

📄 eBPF expliqué : des programmes dans le noyau Linux pour observer sans instrumenter →

My progress

  • ⏱ Estimated time : ≈ 3 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 ...