Socket
Socket
Sign inDemoInstall

@sentry-internal/tracing

Package Overview
Dependencies
4
Maintainers
10
Versions
120
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.62.0 to 7.63.0

9

cjs/node/integrations/mongo.js

@@ -206,9 +206,10 @@ var {

const data = {
collectionName: collection.collectionName,
dbName: collection.dbName,
namespace: collection.namespace,
'db.system': 'mongodb',
'db.name': collection.dbName,
'db.operation': operation,
'db.mongodb.collection': collection.collectionName,
};
const spanContext = {
op: 'db',
// TODO v8: Use `${collection.collectionName}.${operation}`
description: operation,

@@ -237,3 +238,3 @@ data,

for (let i = 0; i < signature.length; i++) {
data[signature[i]] = JSON.stringify(args[i]);
data[`db.mongodb.${signature[i]}`] = JSON.stringify(args[i]);
}

@@ -240,0 +241,0 @@ }

@@ -46,2 +46,28 @@ var {

let mySqlConfig = undefined;
try {
pkg.prototype.connect = new Proxy(pkg.prototype.connect, {
apply(wrappingTarget, thisArg, args) {
if (!mySqlConfig) {
mySqlConfig = thisArg.config;
}
return wrappingTarget.apply(thisArg, args);
},
});
} catch (e) {
(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Mysql Integration was unable to instrument `mysql` config.');
}
function spanDataFromConfig() {
if (!mySqlConfig) {
return {};
}
return {
'server.address': mySqlConfig.host,
'server.port': mySqlConfig.port,
'db.user': mySqlConfig.user,
};
}
// The original function will have one of these signatures:

@@ -59,2 +85,3 @@ // function (callback) => void

data: {
...spanDataFromConfig(),
'db.system': 'mysql',

@@ -61,0 +88,0 @@ },

@@ -65,8 +65,28 @@ var {

const parentSpan = _optionalChain([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]);
const data = {
'db.system': 'postgresql',
};
try {
if (this.database) {
data['db.name'] = this.database;
}
if (this.host) {
data['server.address'] = this.host;
}
if (this.port) {
data['server.port'] = this.port;
}
if (this.user) {
data['db.user'] = this.user;
}
} catch (e) {
// ignore
}
const span = _optionalChain([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
description: typeof config === 'string' ? config : (config ).text,
op: 'db',
data: {
'db.system': 'postgresql',
},
data,
})]);

@@ -73,0 +93,0 @@

@@ -201,9 +201,10 @@ import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';

const data = {
collectionName: collection.collectionName,
dbName: collection.dbName,
namespace: collection.namespace,
'db.system': 'mongodb',
'db.name': collection.dbName,
'db.operation': operation,
'db.mongodb.collection': collection.collectionName,
};
const spanContext = {
op: 'db',
// TODO v8: Use `${collection.collectionName}.${operation}`
description: operation,

@@ -232,3 +233,3 @@ data,

for (let i = 0; i < signature.length; i++) {
data[signature[i]] = JSON.stringify(args[i]);
data[`db.mongodb.${signature[i]}`] = JSON.stringify(args[i]);
}

@@ -235,0 +236,0 @@ }

@@ -41,2 +41,28 @@ import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';

let mySqlConfig = undefined;
try {
pkg.prototype.connect = new Proxy(pkg.prototype.connect, {
apply(wrappingTarget, thisArg, args) {
if (!mySqlConfig) {
mySqlConfig = thisArg.config;
}
return wrappingTarget.apply(thisArg, args);
},
});
} catch (e) {
(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Mysql Integration was unable to instrument `mysql` config.');
}
function spanDataFromConfig() {
if (!mySqlConfig) {
return {};
}
return {
'server.address': mySqlConfig.host,
'server.port': mySqlConfig.port,
'db.user': mySqlConfig.user,
};
}
// The original function will have one of these signatures:

@@ -54,2 +80,3 @@ // function (callback) => void

data: {
...spanDataFromConfig(),
'db.system': 'mysql',

@@ -56,0 +83,0 @@ },

@@ -60,8 +60,28 @@ import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';

const parentSpan = _optionalChain([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]);
const data = {
'db.system': 'postgresql',
};
try {
if (this.database) {
data['db.name'] = this.database;
}
if (this.host) {
data['server.address'] = this.host;
}
if (this.port) {
data['server.port'] = this.port;
}
if (this.user) {
data['db.user'] = this.user;
}
} catch (e) {
// ignore
}
const span = _optionalChain([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
description: typeof config === 'string' ? config : (config ).text,
op: 'db',
data: {
'db.system': 'postgresql',
},
data,
})]);

@@ -68,0 +88,0 @@

{
"name": "@sentry-internal/tracing",
"version": "7.62.0",
"version": "7.63.0",
"description": "Sentry Internal Tracing Package",

@@ -26,5 +26,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/core": "7.62.0",
"@sentry/types": "7.62.0",
"@sentry/utils": "7.62.0",
"@sentry/core": "7.63.0",
"@sentry/types": "7.63.0",
"@sentry/utils": "7.63.0",
"tslib": "^2.4.1 || ^1.9.3"

@@ -31,0 +31,0 @@ },

@@ -5,2 +5,5 @@ import type { Hub } from '@sentry/core';

interface MysqlConnection {
prototype: {
connect: () => void;
};
createQuery: () => void;

@@ -7,0 +10,0 @@ }

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

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc