Project: Instrumented Mini Service

Updated

September 8, 2026

Project: Instrumented Mini Service

Overview

Ship a tiny HTTP service with slog JSON, request IDs, RED-ish expvar/Prometheus counters, livez/readyz, and a shutdown drain.

Checklist

  • GET /api/echo?msg= returns JSON
  • Middleware: request ID + access log
  • Counters: requests_total, requests_failed, latency histogram (or expvar)
  • /livez always 200 if process up
  • /readyz fails when -unready file exists or after SIGTERM
  • Graceful Shutdown
  • README: how to curl probes + sample log line

Stretch

  • OpenTelemetry trace stub
  • Prometheus /metrics via promhttp
  • SLO doc: 99% success, p99 < 200ms on echo

Acceptance

go test ./...
go run . &
curl -s localhost:8080/livez
curl -s localhost:8080/api/echo?msg=hi
kill -TERM $pid  # readyz → 503, then exit