@instana/core
Advanced tools
Comparing version 1.68.4 to 1.69.0
{ | ||
"name": "@instana/core", | ||
"version": "1.68.4", | ||
"version": "1.69.0", | ||
"description": "Core library for Instana's Node.js packages", | ||
@@ -128,3 +128,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "ec37ac1bef979908babd8bc267ab6cb3f2228a1c" | ||
"gitHead": "af167706d3a739a3ec3b69af8d3a7db3b8b48179" | ||
} |
@@ -120,3 +120,3 @@ 'use strict'; | ||
exports.tracingSuppressed = function tracingSuppressed() { | ||
var tl = exports.ns.get(tracingLevelKey); | ||
var tl = exports.tracingLevel(); | ||
return tl && tl === '0'; | ||
@@ -123,0 +123,0 @@ }; |
@@ -21,2 +21,3 @@ 'use strict'; | ||
'./instrumentation/control_flow/bluebird', | ||
'./instrumentation/control_flow/graphqlSubscriptions', | ||
'./instrumentation/database/elasticsearch', | ||
@@ -38,2 +39,3 @@ './instrumentation/database/ioredis', | ||
'./instrumentation/messaging/kafka', | ||
'./instrumentation/protocols/graphql', | ||
'./instrumentation/protocols/grpc', | ||
@@ -40,0 +42,0 @@ './instrumentation/protocols/httpClient', |
@@ -57,7 +57,7 @@ 'use strict'; | ||
} else { | ||
return dispatch.apply(thisContext, arguments); | ||
return dispatch.apply(this, arguments); | ||
} | ||
}; | ||
// The router attaches itself as a property to the dispatch funciton and other methods in koa-router rely on this, se | ||
// The router attaches itself as a property to the dispatch function and other methods in koa-router rely on this, so | ||
// we need to attach this property to our dispatch function, too. | ||
@@ -64,0 +64,0 @@ instrumentedDispatch.router = dispatch.router; |
@@ -33,2 +33,17 @@ 'use strict'; | ||
return function(type, req, res) { | ||
if (type !== 'request' || !isActive) { | ||
return realEmit.apply(this, arguments); | ||
} | ||
var parentSpan = cls.getCurrentSpan(); | ||
if (parentSpan) { | ||
logger.warn( | ||
'Cannot start an HTTP(S) entry span for ' + | ||
(req ? req.url : '(URL not available)') + | ||
' when another span is already active. Currently, the following span is active: ' + | ||
JSON.stringify(parentSpan) | ||
); | ||
return realEmit.apply(this, arguments); | ||
} | ||
var originalThis = this; | ||
@@ -38,2 +53,9 @@ var originalArgs = arguments; | ||
return cls.ns.runAndReturn(function() { | ||
if (req && req.on && req.addListener && req.emit) { | ||
cls.ns.bindEmitter(req); | ||
} | ||
if (res && res.on && res.addListener && res.emit) { | ||
cls.ns.bindEmitter(res); | ||
} | ||
// Respect any incoming tracing level headers | ||
@@ -44,17 +66,6 @@ if (req && req.headers && req.headers[constants.traceLevelHeaderNameLowerCase] === '0') { | ||
if (type !== 'request' || !isActive || cls.tracingSuppressed()) { | ||
if (cls.tracingSuppressed()) { | ||
return realEmit.apply(originalThis, originalArgs); | ||
} | ||
var parentSpan = cls.getCurrentSpan(); | ||
if (parentSpan) { | ||
logger.warn( | ||
'Cannot start an HTTP(S) entry span for ' + | ||
(req ? req.url : '(URL not available)') + | ||
' when another span is already active. Currently, the following span is active: ' + | ||
JSON.stringify(parentSpan) | ||
); | ||
return realEmit.apply(originalThis, originalArgs); | ||
} | ||
var incomingTraceId = getExistingTraceId(req); | ||
@@ -112,5 +123,2 @@ var incomingParentSpanId = getExistingSpanId(req); | ||
cls.ns.bindEmitter(req); | ||
cls.ns.bindEmitter(res); | ||
return realEmit.apply(originalThis, originalArgs); | ||
@@ -117,0 +125,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
6910
6
249039