UNPKG

nice-grpc-prometheus

Version:

Prometheus monitoring for nice-grpc

13 lines (12 loc) 1 kB
import { ClientMiddleware } from 'nice-grpc-common'; import { Counter, Histogram } from 'prom-client'; import { codeLabel, methodLabel, pathLabel, serviceLabel, typeLabel } from './common'; type PrometheusClientMiddlewareOptions = { clientStartedMetric?: Counter<typeof typeLabel | typeof serviceLabel | typeof methodLabel | typeof pathLabel>; clientHandledMetric?: Counter<typeof typeLabel | typeof serviceLabel | typeof methodLabel | typeof pathLabel | typeof codeLabel>; clientStreamMsgReceivedMetric?: Counter<typeof typeLabel | typeof serviceLabel | typeof methodLabel | typeof pathLabel>; clientStreamMsgSentMetric?: Counter<typeof typeLabel | typeof serviceLabel | typeof methodLabel | typeof pathLabel>; clientHandlingSecondsMetric?: Histogram<typeof typeLabel | typeof serviceLabel | typeof methodLabel | typeof pathLabel | typeof codeLabel>; }; export declare function prometheusClientMiddleware(options?: PrometheusClientMiddlewareOptions): ClientMiddleware; export {};