@promster/express
Version:
Express server integrations of promster
27 lines (26 loc) • 1.27 kB
TypeScript
import { Prometheus, Prometheus as Prometheus$1, TRequestRecorder, defaultNormalizers, defaultRegister, getContentType, getSummary, timing } from "@promster/metrics";
import { TLabelValues, TOptionalPromsterOptions } from "@promster/types";
import { Application, NextFunction, Request, Response } from "express";
export type * from "@promster/types";
//#region src/middleware/middleware.d.ts
interface TApp extends Application {
locals: Record<string, unknown>;
}
declare const getRequestRecorder: () => TRequestRecorder;
declare const signalIsUp: () => void;
declare const signalIsNotUp: () => void;
type TSkipFunction = <TRequest = Request, TResponse = Response>(_req: TRequest, _res: TResponse, _labels: TLabelValues) => boolean;
type TPromsterOptions = TOptionalPromsterOptions & {
skip?: TSkipFunction;
};
type TMiddlewareOptions = {
app?: TApp;
options?: TPromsterOptions;
};
declare const createMiddleware: ({
app,
options
}?: TMiddlewareOptions) => (request: Request, response: Response, next: NextFunction) => void;
//#endregion
export { Prometheus, type TPromsterOptions, createMiddleware, defaultNormalizers, defaultRegister, getContentType, getRequestRecorder, getSummary, signalIsNotUp, signalIsUp, timing };
//# sourceMappingURL=index.d.ts.map