feat: TracingChannel-powered observability

Draft
LO
6mo ago
+1551-1347

Draft — Visual comparison of TracingChannel changes on top of #3110

This PR shows the diff of the TracingChannel refactoring on top of the OTel metrics PR (redis/node-redis#3110).

What changed

Core code no longer calls OTel metrics directly. Instead it describes what's happening through diagnostics_channel:

  • trace() — wraps async operations (commands, batches, connections, pool waits) via TracingChannel
  • publish() — emits point events (errors, cache hits, pubsub, maintenance) via dc.channel()

OTel metrics subscribe to these channels externally. Any APM (Sentry, Datadog, custom) can do the same — zero additional surgery to core code.

Key numbers

  • -312 lines removed from existing production code
  • +291 lines new tracing.ts infrastructure (serves all consumers)
  • Net -21 lines of production code
  • Zero OTelMetrics imports in core code
  • Two functions for all observability: trace() and publish()

šŸ¤– Generated with Claude Code