/** * The context for the current request. */ export interface Context { traceID: Uint8Array; spanID: Uint8Array; parentSpanID?: Uint8Array; extRequestID?: string; correlationID?: string; } /** * Used to track the current request context. */ export default class ReqTrack { private readonly localStorage; /** * run the given request handler with the given context, such that any calls to `current()` within the request handler * will return the given context. */ run(ctx: Context, requestHandler: () => Promise): Promise; /** * Returns the current context for the current request, or undefined if there is no current request. */ current(): Context | undefined; /** * Returns a traceparent value for the current span. */ currentTraceParent(): string | undefined; }