grpc-clients-tracking
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

grpc-clients-tracking

npm version npm downloads

Interceptors for the client and server to collect statistics about consumer calls through Prometheus

Install

npm i grpc-clients-tracking

Usage

const { clientInterceptorsFactory, serverInterceptor } = require("grpc-clients-tracking");

/*...*/

const server = await new GrpcHostBuilder()
  /*...*/
  .addInterceptor(serverInterceptor)
  /*...*/
  .bind(grpcBind)
  .buildAsync();

/*...*/
const client = new ServerClient(grpcBind, grpc.credentials.createInsecure(), {
  interceptors: [clientInterceptorsFactory()],
});

Metrics example

# HELP grpc_server_calls_total Total number of calls, made by various consumers.
# TYPE grpc_server_calls_total counter
grpc_server_calls_total{consumer_name="consumer-app",consumer_version="1.0.1",client_version="2.3.5",grpc_method="SayHello",grpc_service="v1.Greeter",grpc_type="unary"} 1

Readme

Keywords

Package Sidebar

Install

npm i grpc-clients-tracking

Weekly Downloads

0

Version

2.1.1

License

MIT

Unpacked Size

9.3 kB

Total Files

8

Last publish

Collaborators

  • dmitriy.litichevskiy