otel-nestjs-instrumentation
Version:
Comprehensive OpenTelemetry instrumentation for NestJS applications - SQS, Kafka, HTTP/2, cron jobs and custom protocols
21 lines • 676 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalContext = void 0;
const async_hooks_1 = require("async_hooks");
const internalContext = new async_hooks_1.AsyncLocalStorage();
class InternalContext {
get store() {
let store = internalContext.getStore();
if (!store)
internalContext.enterWith((store = {}));
return store;
}
get customTransactionId() {
return this.store.customTransactionId;
}
set customTransactionId(value) {
this.store.customTransactionId = value;
}
}
exports.InternalContext = InternalContext;
//# sourceMappingURL=internal-context.js.map