Skip to content

go.missing_correlation_id

Observability Low

Detects HTTP handlers that don’t propagate correlation IDs for distributed tracing.

Without correlation IDs:

  • Can’t trace requests — Logs across services can’t be correlated
  • Debugging nightmare — Finding related events is manual work
  • Slow incident response — More time spent correlating logs
// ❌ Before (no correlation ID)
func handler(w http.ResponseWriter, r *http.Request) {
log.Println("Processing request")
}
// ✅ After (with correlation ID)
func handler(w http.ResponseWriter, r *http.Request) {
correlationID := r.Header.Get("X-Correlation-ID")
if correlationID == "" {
correlationID = uuid.New().String()
}
ctx := context.WithValue(r.Context(), "correlation_id", correlationID)
log.Printf("Processing request correlation_id=%s", correlationID)
w.Header().Set("X-Correlation-ID", correlationID)
}
  • HTTP handlers without correlation ID extraction
  • Log statements without correlation IDs
  • Outgoing requests without ID forwarding