Go API Project Guide
Complete observability rollout for Go HTTP APIs
Use this guide for Go APIs where low latency and predictable resource usage are important.
Architecture Scope
- HTTP middleware and handlers.
- Service/domain packages.
- DB and outbound client boundaries.
Recommended Setup
- Initialize SDK once at process start.
- Instrument middleware for request timing/status.
- Add spans around DB/outbound calls.
- Flush gracefully on SIGTERM.
Minimum Data Contract
service,env,versionin all key events.- Request correlation IDs propagated through handlers.
- Error events with operation context.
Validation Checklist
- Synthetic load emits stable telemetry.
- Slow handlers appear clearly in spans.
- Shutdown path flushes final queue.
Production Hardening
- Keep queues bounded to avoid memory pressure.
- Monitor ingest errors and retries.
- Validate instrumentation after router/middleware changes.
Troubleshooting
- Missing data under load: tune buffering/retry and inspect backpressure.
- Missing spans: instrument all I/O boundaries.
- Inconsistent tags: enforce shared middleware decorators.