@loopback/metrics
Version:
An extension exposes metrics for Prometheus with LoopBack 4
18 lines (17 loc) • 769 B
TypeScript
import { Interceptor, InvocationContext, Provider, ValueOrPromise } from '@loopback/core';
/**
* This interceptor captures metrics for method invocations,
* excluding sequence actions and middleware executed before
* a method is invoked. Please collect metrics at other places
* if you want to cover more than just method invocations.
*/
export declare class MetricsInterceptor implements Provider<Interceptor> {
private static gauge;
private static histogram;
private static counter;
private static summary;
private static setup;
constructor();
value(): <T>(invocationCtx: InvocationContext, next: () => ValueOrPromise<T>) => Promise<T>;
intercept<T>(invocationCtx: InvocationContext, next: () => ValueOrPromise<T>): Promise<T>;
}