Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instana/core

Package Overview
Dependencies
Maintainers
3
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instana/core - npm Package Compare versions

Comparing version 1.67.1 to 1.67.2

src/.index.js.swp

9

package.json
{
"name": "@instana/core",
"version": "1.67.1",
"version": "1.67.2",
"description": "Core library for Instana's Node.js packages",

@@ -111,3 +111,2 @@ "main": "src/index.js",

"emitter-listener": "^1.1.2",
"event-loop-lag": "^1.4.0",
"methods": "^1.1.2",

@@ -119,6 +118,2 @@ "opentracing": "^0.14.3",

},
"optionalDependencies": {
"event-loop-stats": "1.1.0",
"gcstats.js": "1.0.0"
},
"devDependencies": {

@@ -131,3 +126,3 @@ "eslint": "^4.19.1",

},
"gitHead": "90bf48ae5e18b9ffa22004819e485a90c8a3eb04"
"gitHead": "aaf57f2d78c2a9c989c2052b52e7eae3343da4e5"
}

@@ -56,10 +56,28 @@ 'use strict';

if (opts.beforeHandler) {
var originalBeforeHandler = opts.beforeHandler;
opts.beforeHandler = function shimmedBeforeHandler() {
annotateHttpEntrySpanWithPathTemplate(app, opts);
return originalBeforeHandler.apply(this, arguments);
};
var preHandler;
var preHandlerKey;
if (opts.preHandler) {
// In Fastify 2.x, the attribute is called preHandler.
preHandler = opts.preHandler;
preHandlerKey = 'preHandler';
} else if (opts.beforeHandler) {
// In Fastify 1.x, the attribute is called beforeHandler.
preHandler = opts.beforeHandler;
preHandlerKey = 'beforeHandler';
}
if (preHandler) {
if (typeof preHandler === 'function') {
opts[preHandlerKey] = function shimmedPreHandler() {
annotateHttpEntrySpanWithPathTemplate(app, opts);
return preHandler.apply(this, arguments);
};
} else if (Array.isArray(preHandler)) {
opts[preHandlerKey].unshift(function prependedBeforeHandler(request, reply, done) {
annotateHttpEntrySpanWithPathTemplate(app, opts);
done();
});
}
}
return originalRoute.apply(this, arguments);

@@ -66,0 +84,0 @@ };

@@ -116,3 +116,3 @@ 'use strict';

function setHeaders(map, span) {
if (!map || !map.headers || map.headers[constants.traceLevelHeaderName]) {
if (!map || !map.headers || tracingUtil.readAttribCaseInsensitive(map.headers, constants.traceLevelHeaderName)) {
return;

@@ -163,3 +163,3 @@ }

return cls.ns.runAndReturn(function() {
if (headers && headers[constants.traceLevelHeaderName] === '0') {
if (tracingUtil.readAttribCaseInsensitive(headers, constants.traceLevelHeaderName) === '0') {
cls.setTracingLevel('0');

@@ -172,4 +172,4 @@ return originalDispatchMessage.apply(ctx, originalArgs);

constants.ENTRY,
headers[constants.traceIdHeaderName],
headers[constants.spanIdHeaderName]
tracingUtil.readAttribCaseInsensitive(headers, constants.traceIdHeaderName),
tracingUtil.readAttribCaseInsensitive(headers, constants.spanIdHeaderName)
);

@@ -240,15 +240,15 @@ span.ts = Date.now();

if (headers) {
var traceId = headers[constants.traceIdHeaderName];
var parentId = headers[constants.spanIdHeaderName];
if (traceId && parentId) {
span.t = traceId;
span.p = parentId;
}
if (headers[constants.traceLevelHeaderName] === '0') {
cls.setTracingLevel('0');
return result;
}
if (tracingUtil.readAttribCaseInsensitive(headers, constants.traceLevelHeaderName) === '0') {
cls.setTracingLevel('0');
span.cancel();
return result;
}
var traceId = tracingUtil.readAttribCaseInsensitive(headers, constants.traceIdHeaderName);
var parentSpanId = tracingUtil.readAttribCaseInsensitive(headers, constants.spanIdHeaderName);
if (traceId && parentSpanId) {
span.t = traceId;
span.p = parentSpanId;
}
span.ts = Date.now();

@@ -328,22 +328,19 @@ span.stack = tracingUtil.getStackTrace(instrumentedChannelModelGet);

return cls.ns.runAndReturn(function() {
var span = cls.startSpan('rabbitmq', constants.ENTRY);
var fields = result.fields || {};
var headers = result.properties && result.properties.headers ? result.properties.headers : {};
if (headers) {
var traceId = headers[constants.traceIdHeaderName];
var parentId = headers[constants.spanIdHeaderName];
if (traceId && parentId) {
span.t = traceId;
span.p = parentId;
if (tracingUtil.readAttribCaseInsensitive(headers, constants.traceLevelHeaderName) === '0') {
cls.setTracingLevel('0');
if (originalCallback) {
return originalCallback(err, result);
}
if (headers[constants.traceLevelHeaderName] === '0') {
cls.setTracingLevel('0');
if (originalCallback) {
return originalCallback(err, result);
}
return;
}
return;
}
var span = cls.startSpan(
'rabbitmq',
constants.ENTRY,
tracingUtil.readAttribCaseInsensitive(headers, constants.traceIdHeaderName),
tracingUtil.readAttribCaseInsensitive(headers, constants.spanIdHeaderName)
);
span.ts = Date.now();

@@ -350,0 +347,0 @@ span.stack = tracingUtil.getStackTrace(instrumentedChannelModelGet);

@@ -353,2 +353,4 @@ 'use strict';

function readMetadata(metadata, key) {
// The grpc library normalizes keys internally to lower-case, so we do not need to take care of reading
// them case-insensitive ourselves.
var values = metadata.get(key);

@@ -355,0 +357,0 @@ if (values && values.length > 0) {

@@ -93,1 +93,15 @@ 'use strict';

};
exports.readAttribCaseInsensitive = function readAttribCaseInsensitive(object, key) {
if (!object || typeof object !== 'object' || typeof key !== 'string') {
return null;
}
var keyUpper = key.toUpperCase();
var allKeys = Object.keys(object);
for (var i = 0; i < allKeys.length; i++) {
if (typeof allKeys[i] === 'string' && allKeys[i].toUpperCase() === keyUpper) {
return object[allKeys[i]];
}
}
return null;
};

@@ -10,3 +10,4 @@ 'use strict';

requireHook: require('./requireHook'),
slidingWindow: require('./slidingWindow'),
stackTrace: require('./stackTrace')
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc