RousselTMLEARNING

TP · Observability with eBPF: from discovery to expertise

Lab: Troubleshoot a Linux server with bpftrace

What you will learn in this TP
  • Run bpftrace
  • Write one-liners
  • Use the bcc tools
Mode :

All steps and instructions are shown. Recommended for this lab: guided

Introduction #

Context. A server “crawls” from time to time and the usual metrics do not explain why. You use eBPF to observe in detail what is going on.

Prerequisites: Linux host (VM or physical machine, kernel 5.8+), root access  ·  Estimated time: 40 min

Your first eBPF diagnostics.

Hands-on #

Guided steps, with their solutions.

  1. 1. Check the kernel

    Why? eBPF depends on kernel features: check them first before looking for a problem elsewhere.

    Display the kernel version and check that BTF is available.
  2. 2. Run bpftrace

    Why? The container avoids installing packages on a production server.

    Run bpftrace in a privileged container and list the tracepoints related to openat.
  3. 3. Who opens which files?

    Why? Seeing which files are opened often reveals a configuration file re-read in a loop or a missing file.

    Display opened files live, then keep only those of a single process (for example sshd or nginx).
  4. 4. Count and measure

    Why? In-kernel aggregations give a statistical view without flooding the terminal.

    Count system calls per process for 10 s, then plot the latency histogram of vfs_read.
  5. 5. The bcc tools

    Why? These tools answer the most common questions in a single command.

    Install bpfcc-tools, run execsnoop in one terminal and execute for i in $(seq 5); do date; done in another. Then run biolatency during a file copy.

Validate your work

Check that each goal above is reached and that you get the result described in the introduction.

Difficulty level : ●●○○○ (2/5)

My progress

  • ⏱ Estimated time : ≈ 40 min

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

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 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

eBPF best practices for observability

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

Storage on Linux: disks, partitions, file systems and LVM

Administer Linux storage: lsblk and blkid, GPT partitioning, ext4 and XFS, mounting and /etc/fsta...

Installing Fleet Server and enrolling Elastic Agents

Set up Fleet Server, create a policy, enroll Linux, Windows and Docker agents, understand tokens ...

Installing Bindplane: server, BDOT Collector and OpAMP connection

Install the Bindplane server (Docker Compose, Linux, Kubernetes), connect BDOT collectors via OpA...

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

Observing the Kubernetes network with Cilium Hubble

Make a Kubernetes cluster's network flows visible with Cilium Hubble: architecture, the hubble ob...

eBPF in production: security, prerequisites and limits

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

The Bash shell and files: navigation, redirections, pipes and text processing

Master the Linux command line: paths, file handling, wildcards, redirections, pipes, searching wi...

Installing Zabbix and monitoring your first host

Install Zabbix with Docker Compose (server, PostgreSQL, web interface), install agent 2 on a Linu...

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!