traceability
Version:
Traceability tools - middleware and winston logger
23 lines • 849 B
TypeScript
/// <reference types="node" />
import { AsyncLocalStorage } from 'async_hooks';
export interface RequestContext {
[key: string]: string | string[] | undefined;
}
declare class ContextAsyncHooksClass {
private static instance;
asyncLocalStorage: AsyncLocalStorage<any>;
private constructor();
getExpressMiddlewareTracking(config?: {
responseHeaderPropagator?: 'cid' | 'traceparent';
}): any;
setContext(data: RequestContext): void;
getTrackId(contextParam?: RequestContext): RequestContext;
getTraceParent(): string;
private getTraceIdFromTraceParent;
private buildTraceParent;
getContext(): RequestContext | undefined;
static getInstance(): ContextAsyncHooksClass;
}
export declare const ContextAsyncHooks: ContextAsyncHooksClass;
export {};
//# sourceMappingURL=ContextAsyncHooks.d.ts.map