Interceptor for instrumenting gRPC calls with Zipkin distributed tracing. Version 0.0.8 is the latest and only stable release. It provides explicit manual instrumentation hooks for client and server sides, supporting both Node.js and Go gRPC servers. Unlike automatic wrappers, this library requires developers to call methods like beforeClientDoGrpcCall, uponServerRecvGrpcCall, uponServerFinishRespond, and afterGrpcCallFinish manually. It depends on zipkin, zipkin-context-cls, and optionally zipkin-transport-http. It uses a global variable ZIPKIN_GRPC_INTCP to hold the interceptor instance. The library is part of the official OpenZipkin JavaScript project.
npm install zipkin-instrumentation-grpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to initialize Zipkin tracer, create the gRPC interceptor, and use its client/server lifecycle methods for manual distributed tracing.
Ensure only one instance is stored globally, or refactor to avoid global state.
Always call the corresponding finish method in a finally block or after the call completes.
Consider migrating to a more modern context propagation library.
Use grpc package version <1.24 or manually adapt the metadata handling.
Always pass the string '1' for sampling.
Use: const ZipkinGrpcInterceptor = require('zipkin-instrumentation-grpc'); const interceptor = new ZipkinGrpcInterceptor(tracer);Set: global.ZIPKIN_GRPC_INTCP = new (require('zipkin-instrumentation-grpc'))(tracer);Pass the Tracer instance, not the class: const tracer = new Tracer({...}); new ZipkinGrpcInterceptor(tracer);Ensure grpcMetadataFromIncomingCtx is set to call.metadata from the gRPC server call object.