Lesson 2 of 4 · Free to read
Exercises
Exercises — Profiling, eBPF, Beyla & Hubble
Watch & learn
Course video
Course video
Keep a lab notebook: hypothesis → command → result. Speed without evidence is not a skill.
How to use this file
- Work Lab A → B → C on the same
orders-labrepo - Prefer Docker Desktop; use Kind when the lab says so
- Definition of Done at the bottom is the phase gate
Lab A — First flamegraph
Time: 45–60 min
Goal: Pyroscope shows worker CPU profile under load.
Setup
Pyroscope in stack; load generator.
Steps
- Enable profiling export from worker or Alloy pull.
- Generate CPU load.
- Open flamegraph; identify top frames.
Success criteria
- Flamegraph captured with readable frames
If stuck
No data? Check scrape interval and that the process exposes pprof/Pyroscope agent.
Lab B — Hunt a planted bug
Time: 60–90 min
Goal: Find and fix a leak or hot path using profiles + traces.
Setup
Intentionally buggy worker branch.
Steps
- Reproduce with steady traffic.
- Correlate slow Tempo span with Pyroscope hotspot.
- Fix and re-measure.
Success criteria
- Before/after profiles saved
- Latency improved
If stuck
Always compare same load script before/after.
Lab C — Beyla zero-code floor
Time: 45–60 min
Goal: See RED/traces without SDK on a throwaway service.
Setup
Kind + Beyla DaemonSet or compose sidecar.
Steps
- Deploy Beyla targeting your api labels.
- Export OTLP to Collector.
- Write a comparison table: SDK vs Beyla coverage for SNS→SQS.
Success criteria
- Beyla signals visible
- Honest gap table committed
If stuck
Kernel/permissions issues are common on Docker Desktop — document what you could/couldn’t run.
Stretch goals
- Explore Hubble flows for worker → LocalStack path
Definition of Done
- Flamegraph interpreted correctly
- One performance bug fixed with evidence
- SDK vs eBPF comparison written
Exercises — Profiling, eBPF, Beyla & Hubble.