nexstream-api / backend /src /utils /infra /trace.util.ts
nexstream-deploy
deploy: nexstream backend (experiment)
2276d59
Raw
History Blame Contribute Delete
273 Bytes
import { AsyncLocalStorage } from 'node:async_hooks';
export interface TraceContext {
traceId: string;
}
export const traceContext = new AsyncLocalStorage<TraceContext>();
export function getTraceId(): string | undefined {
return traceContext.getStore()?.traceId;
}