This article is available in French.
1. eBPF en quelques mots #
Une machine virtuelle dans le noyau.
Le principe #
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 #
| Hook | Déclenché par | Exemple d'usage |
|---|---|---|
| tracepoint | Point d'instrumentation stable du noyau | Appels système, ordonnanceur, réseau |
| kprobe / kretprobe | Entrée / sortie d'une fonction du noyau | Latence de vfs_read |
| uprobe / uretprobe | Entrée / sortie d'une fonction d'un programme | SSL_write d'OpenSSL : voir le HTTP avant chiffrement |
| perf event | Minuterie ou compteur matériel | Profiling CPU par échantillonnage |
| XDP / TC | Paquet réseau (avant ou dans la pile) | Filtrage, répartition de charge, flux réseau |
| LSM | Contrô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| Outil | Catégorie |
|---|---|
| bpftrace, bcc | Diagnostic ponctuel en ligne de commande |
| Grafana Beyla / OpenTelemetry eBPF Instrumentation | Métriques RED et traces des applications |
| Cilium Hubble | Flux réseau Kubernetes |
| Pyroscope, Parca, profiler eBPF OpenTelemetry | Profiling continu |
| Tetragon, Falco | Observabilité de sécurité |
My progress
Sign in to track your progress and take notes. Sign in
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 ...