Interceptor for Redis clients that automatically creates spans for Redis commands and adds Zipkin tracing context. Part of the Zipkin JavaScript library (v0.22.0), maintained by OpenZipkin. This package wraps the 'redis' npm client to produce distributed tracing spans. Release cadence is tied to the monorepo release cycle (approximately quarterly). Key differentiators: native Zipkin integration, support for Redis callbacks and promises, and automatic span propagation without manual instrumentation. Requires 'zipkin' and 'redis' as peer dependencies.
npm install zipkin-instrumentation-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Zipkin tracer, wraps a Redis client to automatically trace commands, and sets a key with a callback.
Always pass { tracer } as the second argument to wrapRedisClient.Wrap a client instance: wrapRedisClient(client, { tracer }).Use the returned tracedClient, but note that the original client is also traced after this call.
For ioredis, use 'zipkin-instrumentation-ioredis' instead.
Use 'import { wrapRedisClient } from 'zipkin-instrumentation-redis''Create a client first: const client = redis.createClient(); const traced = wrapRedisClient(client, { tracer });Pass { tracer: yourTracer } as second argument.Ensure tracer has a recorder (e.g., ConsoleRecorder for testing).