Documentation

Logging, Metrics, Tracing

Instrument APIs with logs, metrics, and tracing hooks.

Overview

Expose metrics and structured logs to support incident response and scaling.

Example

Go

metrics := observability.NewMetrics()
app.Use(metrics.Middleware())
metrics.RegisterRoute(app, "/metrics")

Best Practices

  • Attach request and trace IDs to logs.
  • Track latency and error-rate per route group.

Common Pitfalls

  • Missing metrics on error paths.
  • Sampling traces without documenting policy.