The Desi Architect
Notes / Docker Sandboxes / Logs, Metrics and Traces: Three Ways to Find What Is Slow
Docker Sandboxes · Tier 3: Reliability & Messaging · Lab 46

Logs, Metrics and Traces: Three Ways to Find What Is Slow

One tiny two-service shop, three kinds of evidence. Find a slow request with logs and see why that is hard, spot the problem with a metric and see what it cannot tell you, then find the exact slow step with a trace.

Time30 minutes
StackTwo servicesPorts 18160, 18161
MemoryAbout 60 MB
Before thisLab 03HTTP Caching Headers & DNS Resolut
Verified runWindows, Mac, LinuxBash and PowerShell
  1. 1PrepareWhat you will learn
  2. 2PredictGuess before you run
  3. 3RunStep by step
  4. 4ObserveWhat you should see
  5. 5Break itChange one thing
  6. 6Clean upLeave nothing running
On this page
  1. 00 / What You Will Learn
  2. 01 / Why It Matters
  3. 02 / What We Are Building
  4. 03 / Words You Need
  5. 04 / Predict First
  6. 05 / Step by Step
  7. 06 / What You Should See
  8. 07 / Look Inside
  9. 08 / Break It, Fix It
  10. 09 / In Real Projects
  11. 10 / Interview Corner
  12. 11 / Clean Up

00 /What You Will Learn

By the end you will be able to
  • Say what logs, metrics and traces are, and which question each answers.
  • Find a slow request with logs, and see why it is slow work across services.
  • Read a histogram metric and estimate p95 from its buckets.
  • Read a trace: spans, nesting and the slowest step.
  • Explain propagation, and what a broken trace looks like.

Before you start

Finish Lab 03 (HTTP, Caching and DNS) and Lab 09 (Latency and Percentiles) first. You should know what a request, a header and a percentile are. No monitoring tool is needed. The three kinds of evidence are produced by about 100 lines of Python.