StoicBuilder
Later missionMission 39: First day on the platform teamYou can practise it now. It counts once you reach mission 39, after “An API customers can build on”.Back to HQ
Exit lesson
Tracing a slow requestProLesson 34 of 45, about 8 min
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
0 XP

The app: Beacon, logs, metrics and traces

Beaconharbor · production13:45 UTC
POST /api/checkout latency
750 msaverage, last 5 minutes
at 13:00 it was 380 ms
02 s4 s6 s12:0012:3013:0013:3013:10

What Beacon stores

Query how Beacon draws the lineaverage
sum(rate(http_server_request_duration_seconds_sum{http_route="/api/checkout"}[5m]))
/
sum(rate(http_server_request_duration_seconds_count{http_route="/api/checkout"}[5m]))
Histogram checkout requests in the last 5 minutes, by duration (s)300 requests
http_server_request_duration_seconds_bucket{http_route="/api/checkout"}
le="0.1" +6
le="0.25" +98
le="0.5" +143
le="0.75" +16
le="1" +3
le="2.5" +2
le="5" +27
le="7.5" +4
le="10" +1
le="+Inf"
http_server_request_duration_seconds_sum 226.1
http_server_request_duration_seconds_count 300

The MagisterThis is Beacon, where Harbor’s metrics, traces and logs live. The chart shows checkout’s average latency, and it looks calm. Averages hide the slow tail: switch to p95, the time 95 of every 100 requests beat. Then tap the histogram line where the slow ones land.

Step 1 of 7Switch to p95, then find the slow requests
  • The chart shows p95
  • Tap the bucket count that jumps between 2.5 s and 5 s

You’re not signed in, so this lesson won’t be saved to your path. Sign in free to keep your XP.