You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A complete container observability lab built around a Go HTTP service that
simulates real-world failure modes — memory leaks, latency spikes, and error
bursts. The stack wires Prometheus, Grafana, OpenTelemetry Collector,
cAdvisor, and Node Exporter together so you can practise incident
detection and response with production-grade tooling.
# Generate a memory leak over 50 requests
./scripts/simulate-leak.sh 50 2
# Observe in Grafana → Go API Observability dashboard# Resolve with:
curl -X POST http://localhost:8080/reset
Key Design Decisions
prometheus/client_golang — Native Prometheus instrumentation exposes
http_requests_total (CounterVec) and http_request_duration_seconds
(HistogramVec) per method, path, and status code.
Path normalisation — Endpoint labels are collapsed to a known set to
prevent high-cardinality label explosion in Prometheus.
statusRecorder middleware — Wraps http.ResponseWriter to capture the
status code written by downstream handlers without buffering the body.
Memory safety cap — /leak stops allocating after 200 chunks (~200 MB)
to avoid killing the container before you can observe the trend.
Container memory limit — mem_limit: 256m in Compose mirrors a
production constraint so cAdvisor shows realistic pressure.
Multi-stage Docker build — go mod tidy runs at build time so the image
builds without a local Go toolchain.