What problem does it solve?
Provides a complete, opinionated playbook to make Go services observable in production by adding structured logging, reliable Prometheus metrics, OpenTelemetry tracing, continuous profiling, RUM event tracking, alerting, and dashboards so teams can detect, diagnose, and resolve issues quickly.
Core Features & Use Cases
- Structured logging: migrate legacy loggers to log/slog, emit JSON logs, and attach trace context via *Context variants so logs correlate with traces.
- Metrics & alerting: prefer histograms for latency, keep label cardinality low, include PromQL comments above metric declarations, and use awesome-prometheus-alerts for dependency rules.
- Tracing & correlation: set up OpenTelemetry TracerProvider, create spans for service methods/DB/external calls, record errors with RecordError + SetStatus, and use exemplars to link metrics to traces.
- Profiling & RUM: enable pprof securely and toggle continuous profiling (Pyroscope) via environment variables; use user_id (not email) for server-side RUM and respect consent checks.
- Use case: instrument a new HTTP endpoint so it emits JSON logs with trace_id, exposes histogram latency metrics with low-cardinality labels, creates spans for DB calls, and wires alerts and Grafana panels.
Quick Start
Instrument my Go HTTP handler with slog JSON logging that uses Info level in production, add a Prometheus histogram for request duration with route-pattern labels, create OpenTelemetry spans for service and DB calls, and enable pprof/pyroscope toggles via PROFILING_ENABLED.