UNPKG

newrelic-nestjs-instrumentation

Version:

Comprehensive New Relic instrumentation for NestJS applications - SQS, Kafka, HTTP/2, cron jobs and custom protocols

19 lines 706 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNewrelicContext = getNewrelicContext; exports.setNewrelicContext = setNewrelicContext; const newrelic_1 = __importDefault(require("newrelic")); const newrelicContext = Symbol('newrelicContext'); const tracer = newrelic_1.default.agent?.tracer; function getNewrelicContext() { return tracer?.getContext(); } function setNewrelicContext(context) { if (!context) return; tracer?._contextManager.setContext(context); } //# sourceMappingURL=newrelic-context.js.map