rbi-nodejs-agent
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -184,2 +184,3 @@ "use strict"; | ||
tracer.add(span); | ||
res.setHeader('x-rebugit-traceid', tracer.traceId); | ||
next(); | ||
@@ -214,3 +215,3 @@ _a.label = 3; | ||
return function (event, context, callback) { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, context_1, event_1, wrappedCallback; | ||
var traces, _a, context_1, event_1, wrappedCallback; | ||
var _this = this; | ||
@@ -220,9 +221,12 @@ return __generator(this, function (_b) { | ||
case 0: | ||
this._initIntegrations(tracer); | ||
if (!(this.env === constants_1.Environments.DEBUG)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, lambdaIntegration.extractRequest()]; | ||
return [4 /*yield*/, this.api.findByTraceId(process.env.REBUGIT_TRACE_ID)]; | ||
case 1: | ||
_a = _b.sent(), context_1 = _a.context, event_1 = _a.event; | ||
traces = _b.sent(); | ||
this.tracesLoader.load(traces); | ||
this._initIntegrations(tracer); | ||
_a = lambdaIntegration.extractRequest(), context_1 = _a.context, event_1 = _a.event; | ||
return [2 /*return*/, func(event_1, context_1)]; | ||
case 2: | ||
this._initIntegrations(tracer); | ||
lambdaIntegration.captureRequest({ event: event, context: context }); | ||
@@ -229,0 +233,0 @@ _b.label = 3; |
@@ -54,2 +54,3 @@ "use strict"; | ||
var constants_1 = require("./constants"); | ||
var constants_2 = require("../sharedKernel/constants"); | ||
var logger = require('../logger'); | ||
@@ -68,3 +69,3 @@ var EnvironmentIntegration = /** @class */ (function (_super) { | ||
this.configuration = config || {}; | ||
if (this.env === 'debug') { | ||
if (this.env === constants_2.Environments.DEBUG) { | ||
this.cleanEnvironment(); | ||
@@ -71,0 +72,0 @@ var data = tracesLoader.get(constants_1.OperationsType.ENVIRONMENT); |
@@ -86,14 +86,3 @@ "use strict"; | ||
LambdaIntegration.prototype.extractRequest = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var traces; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.api.findByTraceId(process.env.REBUGIT_TRACE_ID)]; | ||
case 1: | ||
traces = _a.sent(); | ||
this.tracesLoader.load(traces); | ||
return [2 /*return*/, this.tracesLoader.get(constants_1.CorrelationIds.LAMBDA_REQUEST)]; | ||
} | ||
}); | ||
}); | ||
return this.tracesLoader.get(constants_1.CorrelationIds.LAMBDA_REQUEST); | ||
}; | ||
@@ -100,0 +89,0 @@ LambdaIntegration.prototype.wrapCallback = function (originalCallback, closeIntegrationCallback) { |
{ | ||
"name": "rbi-nodejs-agent", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
135726
2110