0.2.5 • Published 5 years ago

@pionerlabs/grpc-interceptors v0.2.5

Weekly downloads
111
License
ISC
Repository
github
Last release
5 years ago

grpc-interceptors

This library provides a way to instrument Node.js gRPC clients and servers with interceptors/middleware e.g. for Prometheus metrics, Zipkin tracing etc.

Usage

const interceptors = require('grpc-interceptors');

const server = interceptors.serverProxy(new grpc.Server());
server.addService(proto.MyPackage.MyService.service, { Method1, Method2 });

const myMiddlewareFunc = function (ctx, next) {

    // do stuff before call
    console.log('Making gRPC call...');

    await next()

    // do stuff after call
    console.log(ctx.status.code);
}

server.use(myMiddlewareFunc);

Available Interceptors

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago