COURSE / REAL PRACTICE
Instrument a tiny service
Connect a running Go notes service to structured logs, server-owned request IDs, bounded counters and honest latency distributions.
Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.
What you’ll work toward
Add tested instrumentation to the working notes API, reproduce a fixture failure and connect an actual request to its emitted log, counter series and latency distribution. Run an owned loopback service with local telemetry and explicit cleanup.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.
A look inside the first lesson
Define the telemetry contract and inject a clock
package main
import ("fmt";"time")
func main(){
start:=time.Unix(0,0);for _,d:=range []time.Duration{0,999*time.Microsecond,12*time.Millisecond}{fmt.Println(start.Add(d).Sub(start).Milliseconds())}
}Your lesson sequence
Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.
Timing, correlation and safe events
- LESSON 01.01
Define the telemetry contract and inject a clock
Measure whole elapsed milliseconds with a replaceable clock and distinguish a measured zero from invalid timing.
Open lesson - LESSON 01.02
Carry a server-owned request ID through context
Use a private context key, preserve cancellation and correlate one response without trusting incoming identity claims or creating metric labels.
Open lesson - LESSON 01.03
Emit a structured event with an allowlist
Serialize only approved bounded fields, omit sensitive source data and preserve null versus measured zero timing.
Open lesson
Metrics and incident evidence
- LESSON 02.01
Count requests with bounded labels and precise error semantics
Aggregate normalized method/route/status classes, separate server statuses from aborted/write-error outcomes and prevent cardinality from growing with IDs.
Open lesson - LESSON 02.02
Measure a distribution and report honest tail bounds
Observe cumulative inclusive buckets, retain count/sum for weighted means and distinguish an empty or unbounded p95 from an exact quantile.
Open lesson - LESSON 02.03
Connect an incident to emitted evidence
Reconcile each log event with its counter series, identify a failing route and exemplar, and keep correlation distinct from a proven root cause.
Open lesson