Comparing version 1.2.12 to 1.2.13-0
@@ -7,2 +7,3 @@ 'use strict' | ||
var util = require('util') | ||
var stackUtil = require('../util/stack') | ||
var crypto = require('crypto') | ||
@@ -12,4 +13,2 @@ var encode = require('../util/codec.js').encode | ||
var NR_ROOT = path.resolve(__dirname, '../..') | ||
module.exports = QueryTracer | ||
@@ -178,3 +177,3 @@ | ||
this.metric = segment.name | ||
this.trace = formatTrace(trace) | ||
this.trace = stackUtil.formatStack(trace.stack) // trace is an Error object, for capturing the stack. | ||
this.duration = segment.getDurationInMillis() | ||
@@ -187,11 +186,2 @@ } | ||
function formatTrace(trace) { | ||
// remove error message and instrumentation frames from stack trace | ||
return trace ? trace.stack.split('\n').slice(1).filter(notNR).join('\n') : '' | ||
} | ||
function notNR(frame) { | ||
return frame.indexOf(NR_ROOT) === -1 | ||
} | ||
function getQuery(config, trace) { | ||
@@ -198,0 +188,0 @@ switch (config.transaction_tracer.record_sql) { |
@@ -6,2 +6,3 @@ 'use strict'; | ||
, logger = require(path.join(__dirname, '..', '..', 'logger')).child({component : 'http'}) | ||
, stackUtil = require(path.join(__dirname, '..', '..', 'util', 'stack' ) ) | ||
, recordWeb = require(path.join(__dirname, '..', '..', 'metrics', | ||
@@ -43,2 +44,5 @@ 'recorders', 'http.js')) | ||
var stack = (new Error()).stack; | ||
segment.parameters.backtrace = stackUtil.formatStack( stack ); | ||
// the error tracer needs a URL for tracing, even though naming overwrites | ||
@@ -45,0 +49,0 @@ transaction.url = request.url; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
, shimmer = require(path.join(__dirname, '..', 'shimmer.js')) | ||
, stackUtil = require(path.join(__dirname, '..', 'util', 'stack' )) | ||
, recordMemcache = require(path.join(__dirname, '..', 'metrics', | ||
@@ -66,2 +67,6 @@ 'recorders', 'memcached.js')) | ||
// Add backtrace to segment. | ||
var stack = (new Error()).stack; | ||
segment.parameters.backtrace = stackUtil.formatStack( stack ); | ||
/* Memcached's call description includes a callback to apply when the | ||
@@ -68,0 +73,0 @@ * operation is concluded. Wrap that to trace the duration of the |
@@ -6,2 +6,3 @@ "use strict"; | ||
shimmer = require(path.join(__dirname, '..', 'shimmer')), | ||
stackUtil = require(path.join(__dirname, '..', 'util', 'stack.js')), | ||
urltils = require(path.join(__dirname, '..', 'util', 'urltils.js')), | ||
@@ -151,2 +152,5 @@ logger = require(path.join(__dirname, '..', | ||
} | ||
// Add backtrace to segment. | ||
var stack = (new Error()).stack; | ||
segment.parameters.backtrace = stackUtil.formatStack( stack ); | ||
@@ -153,0 +157,0 @@ var callback = args.pop(); |
@@ -5,2 +5,3 @@ 'use strict'; | ||
, shimmer = require(path.join(__dirname, '..', 'shimmer')) | ||
, stackUtil = require(path.join(__dirname, '..', 'util', 'stack')) | ||
, logger = require(path.join(__dirname, '..', 'logger')) | ||
@@ -47,2 +48,5 @@ .child({component : 'node-cassandra-cql'}) | ||
var stack = (new Error()).stack; | ||
segment.parameters.backtrace = stackUtil.formatStack( stack ); | ||
function finalize(target) { | ||
@@ -78,2 +82,2 @@ return function cls_finalize() { | ||
}); | ||
}; | ||
}; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
, shimmer = require(path.join(__dirname, '..', 'shimmer')) | ||
, stackUtil = require(path.join(__dirname, '..', 'util', 'stack' ) ) | ||
, logger = require(path.join(__dirname, '..', 'logger')) | ||
@@ -38,2 +39,6 @@ .child({component : 'redis'}) | ||
segment.parameters.key = JSON.stringify([keys[0]]); | ||
var stack = ( new Error() ).stack; | ||
segment.parameters.backtrace = stackUtil.formatStack( stack ); | ||
} | ||
@@ -40,0 +45,0 @@ |
'use strict'; | ||
var path = require('path') | ||
, stackUtil = require( '../../../util/stack' ) | ||
, recordExternal = require(path.join(__dirname, '..', '..', '..', 'metrics', | ||
@@ -31,2 +32,3 @@ 'recorders', 'http_external.js')) | ||
segment.parameters["uri"] = uri; | ||
segment.parameters["backtrace"] = stackUtil.formatStack( (new Error()).stack ); | ||
@@ -33,0 +35,0 @@ // may trace errors multiple times, make that the error tracer's problem |
{ | ||
"name": "oneapm", | ||
"version": "1.2.12", | ||
"version": "1.2.13-0", | ||
"author": "OneAPM Node.js agent team <nodejs@oneapm.com>", | ||
@@ -5,0 +5,0 @@ "description": "OneAPM agent", |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
337102
69
9086
1
153