dd-trace
Advanced tools
Comparing version 3.53.0 to 3.54.0
@@ -23,5 +23,5 @@ /* eslint-disable no-console */ | ||
} else { | ||
console.error(`DD_CIVISIBILITY_AGENTLESS_ENABLED is set, \ | ||
but neither DD_API_KEY nor DATADOG_API_KEY are set in your environment, \ | ||
so dd-trace will not be initialized.`) | ||
console.error('DD_CIVISIBILITY_AGENTLESS_ENABLED is set, but neither ' + | ||
'DD_API_KEY nor DATADOG_API_KEY are set in your environment, so ' + | ||
'dd-trace will not be initialized.') | ||
shouldInit = false | ||
@@ -28,0 +28,0 @@ } |
{ | ||
"name": "dd-trace", | ||
"version": "3.53.0", | ||
"version": "3.54.0", | ||
"description": "Datadog APM tracing client for JavaScript", | ||
@@ -76,3 +76,3 @@ "main": "index.js", | ||
"@datadog/native-metrics": "^2.0.0", | ||
"@datadog/pprof": "5.1.0", | ||
"@datadog/pprof": "5.2.0", | ||
"@datadog/sketches-js": "^2.1.0", | ||
@@ -99,3 +99,3 @@ "@opentelemetry/api": "^1.0.0", | ||
"path-to-regexp": "^0.1.2", | ||
"pprof-format": "^2.0.7", | ||
"pprof-format": "^2.1.0", | ||
"protobufjs": "^7.2.5", | ||
@@ -121,7 +121,6 @@ "retry": "^0.13.1", | ||
"eslint": "^8.23.0", | ||
"eslint-config-standard": "^11.0.0-beta.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-mocha": "^10.1.0", | ||
"eslint-plugin-n": "^15.7.0", | ||
"eslint-plugin-node": "^5.2.1", | ||
"eslint-plugin-promise": "^3.6.0", | ||
@@ -128,0 +127,0 @@ "eslint-plugin-standard": "^3.0.1", |
@@ -92,3 +92,3 @@ 'use strict' | ||
try { | ||
pathToPackageJson = require.resolve(`${extracted.pkg}/package.json`, { paths: [ args.resolveDir ] }) | ||
pathToPackageJson = require.resolve(`${extracted.pkg}/package.json`, { paths: [args.resolveDir] }) | ||
} catch (err) { | ||
@@ -177,3 +177,3 @@ if (err.code === 'MODULE_NOT_FOUND') { | ||
return require.resolve(path, { paths: [ directory ] }) | ||
return require.resolve(path, { paths: [directory] }) | ||
} | ||
@@ -180,0 +180,0 @@ |
@@ -40,3 +40,3 @@ 'use strict' | ||
resolve({ | ||
headers: headers, | ||
headers, | ||
status: abortData.statusCode, | ||
@@ -43,0 +43,0 @@ body: { |
@@ -17,3 +17,2 @@ const { | ||
const executorCh = channel('apm:apollo:gateway:request:executor') | ||
const generalErrorCh = channel('apm:apollo:gateway:general:error') | ||
@@ -23,5 +22,6 @@ | ||
return function (...args) { | ||
const channel = CHANNELS['gateway.request'] | ||
const ctx = { requestContext: args[0], gateway: this } | ||
executorCh.publish(ctx) | ||
return executor.apply(this, args) | ||
return channel.tracePromise(executor, ctx, this, ...args) | ||
} | ||
@@ -72,3 +72,5 @@ } | ||
} | ||
// Patch `executor` instead so the requestContext can be captured. | ||
case 'gateway.request': | ||
break | ||
case 'gateway.execute': | ||
@@ -75,0 +77,0 @@ case 'gateway.postprocessing' : |
@@ -114,2 +114,3 @@ 'use strict' | ||
function wrapCb (cb, serviceName, request, ar) { | ||
// eslint-disable-next-line n/handle-callback-err | ||
return function wrappedCb (err, response) { | ||
@@ -167,3 +168,5 @@ const obj = { request, response } | ||
'sqs' | ||
].includes(name) ? name : 'default' | ||
].includes(name) | ||
? name | ||
: 'default' | ||
} | ||
@@ -170,0 +173,0 @@ |
@@ -13,3 +13,3 @@ 'use strict' | ||
const errorCh = channel('apm:cassandra-driver:query:error') | ||
const connectCh = channel(`apm:cassandra-driver:query:connect`) | ||
const connectCh = channel('apm:cassandra-driver:query:connect') | ||
@@ -16,0 +16,0 @@ addHook({ name: 'cassandra-driver', versions: ['>=3.0.0'] }, cassandra => { |
@@ -135,3 +135,4 @@ 'use strict' | ||
const { status, skipReason, errorMessage } = isLatestVersion | ||
? getStatusFromResultLatest(result) : getStatusFromResult(result) | ||
? getStatusFromResultLatest(result) | ||
: getStatusFromResult(result) | ||
@@ -181,3 +182,4 @@ if (lastStatusByPickleId.has(this.pickle.id)) { | ||
const { status, skipReason, errorMessage } = isLatestVersion | ||
? getStatusFromResultLatest(result) : getStatusFromResult(result) | ||
? getStatusFromResultLatest(result) | ||
: getStatusFromResult(result) | ||
@@ -295,2 +297,4 @@ testFinishCh.publish({ isStep: true, status, skipReason, errorMessage }) | ||
knownTests = knownTestsResponse.knownTests | ||
} else { | ||
isEarlyFlakeDetectionEnabled = false | ||
} | ||
@@ -297,0 +301,0 @@ } |
@@ -1,2 +0,1 @@ | ||
'use strict' | ||
@@ -3,0 +2,0 @@ |
@@ -14,3 +14,3 @@ 'use strict' | ||
const receiveStartCh = channel(`apm:google-cloud-pubsub:receive:start`) | ||
const receiveStartCh = channel('apm:google-cloud-pubsub:receive:start') | ||
const receiveFinishCh = channel('apm:google-cloud-pubsub:receive:finish') | ||
@@ -17,0 +17,0 @@ const receiveErrorCh = channel('apm:google-cloud-pubsub:receive:error') |
@@ -26,32 +26,32 @@ 'use strict' | ||
'@smithy/smithy-client': () => require('../aws-sdk'), | ||
'aerospike': () => require('../aerospike'), | ||
'amqp10': () => require('../amqp10'), | ||
'amqplib': () => require('../amqplib'), | ||
aerospike: () => require('../aerospike'), | ||
amqp10: () => require('../amqp10'), | ||
amqplib: () => require('../amqplib'), | ||
'aws-sdk': () => require('../aws-sdk'), | ||
'bluebird': () => require('../bluebird'), | ||
bluebird: () => require('../bluebird'), | ||
'body-parser': () => require('../body-parser'), | ||
'bunyan': () => require('../bunyan'), | ||
bunyan: () => require('../bunyan'), | ||
'cassandra-driver': () => require('../cassandra-driver'), | ||
'child_process': () => require('../child_process'), | ||
'connect': () => require('../connect'), | ||
'cookie': () => require('../cookie'), | ||
child_process: () => require('../child_process'), | ||
connect: () => require('../connect'), | ||
cookie: () => require('../cookie'), | ||
'cookie-parser': () => require('../cookie-parser'), | ||
'couchbase': () => require('../couchbase'), | ||
'crypto': () => require('../crypto'), | ||
'cypress': () => require('../cypress'), | ||
'dns': () => require('../dns'), | ||
'elasticsearch': () => require('../elasticsearch'), | ||
'express': () => require('../express'), | ||
couchbase: () => require('../couchbase'), | ||
crypto: () => require('../crypto'), | ||
cypress: () => require('../cypress'), | ||
dns: () => require('../dns'), | ||
elasticsearch: () => require('../elasticsearch'), | ||
express: () => require('../express'), | ||
'express-mongo-sanitize': () => require('../express-mongo-sanitize'), | ||
'fastify': () => require('../fastify'), | ||
fastify: () => require('../fastify'), | ||
'find-my-way': () => require('../find-my-way'), | ||
'fs': () => require('../fs'), | ||
fs: () => require('../fs'), | ||
'generic-pool': () => require('../generic-pool'), | ||
'graphql': () => require('../graphql'), | ||
'grpc': () => require('../grpc'), | ||
'hapi': () => require('../hapi'), | ||
'http': () => require('../http'), | ||
'http2': () => require('../http2'), | ||
'https': () => require('../http'), | ||
'ioredis': () => require('../ioredis'), | ||
graphql: () => require('../graphql'), | ||
grpc: () => require('../grpc'), | ||
hapi: () => require('../hapi'), | ||
http: () => require('../http'), | ||
http2: () => require('../http2'), | ||
https: () => require('../http'), | ||
ioredis: () => require('../ioredis'), | ||
'jest-circus': () => require('../jest'), | ||
@@ -63,22 +63,22 @@ 'jest-config': () => require('../jest'), | ||
'jest-worker': () => require('../jest'), | ||
'knex': () => require('../knex'), | ||
'koa': () => require('../koa'), | ||
knex: () => require('../knex'), | ||
koa: () => require('../koa'), | ||
'koa-router': () => require('../koa'), | ||
'kafkajs': () => require('../kafkajs'), | ||
'ldapjs': () => require('../ldapjs'), | ||
kafkajs: () => require('../kafkajs'), | ||
ldapjs: () => require('../ldapjs'), | ||
'limitd-client': () => require('../limitd-client'), | ||
'mariadb': () => require('../mariadb'), | ||
'memcached': () => require('../memcached'), | ||
mariadb: () => require('../mariadb'), | ||
memcached: () => require('../memcached'), | ||
'microgateway-core': () => require('../microgateway-core'), | ||
'mocha': () => require('../mocha'), | ||
mocha: () => require('../mocha'), | ||
'mocha-each': () => require('../mocha'), | ||
'moleculer': () => require('../moleculer'), | ||
'mongodb': () => require('../mongodb'), | ||
moleculer: () => require('../moleculer'), | ||
mongodb: () => require('../mongodb'), | ||
'mongodb-core': () => require('../mongodb-core'), | ||
'mongoose': () => require('../mongoose'), | ||
'mquery': () => require('../mquery'), | ||
'mysql': () => require('../mysql'), | ||
'mysql2': () => require('../mysql2'), | ||
'net': () => require('../net'), | ||
'next': () => require('../next'), | ||
mongoose: () => require('../mongoose'), | ||
mquery: () => require('../mquery'), | ||
mysql: () => require('../mysql'), | ||
mysql2: () => require('../mysql2'), | ||
net: () => require('../net'), | ||
next: () => require('../next'), | ||
'node:child_process': () => require('../child_process'), | ||
@@ -91,24 +91,24 @@ 'node:crypto': () => require('../crypto'), | ||
'node:net': () => require('../net'), | ||
'oracledb': () => require('../oracledb'), | ||
'openai': () => require('../openai'), | ||
'paperplane': () => require('../paperplane'), | ||
oracledb: () => require('../oracledb'), | ||
openai: () => require('../openai'), | ||
paperplane: () => require('../paperplane'), | ||
'passport-http': () => require('../passport-http'), | ||
'passport-local': () => require('../passport-local'), | ||
'pg': () => require('../pg'), | ||
'pino': () => require('../pino'), | ||
pg: () => require('../pg'), | ||
pino: () => require('../pino'), | ||
'pino-pretty': () => require('../pino'), | ||
'playwright': () => require('../playwright'), | ||
playwright: () => require('../playwright'), | ||
'promise-js': () => require('../promise-js'), | ||
'promise': () => require('../promise'), | ||
'q': () => require('../q'), | ||
'qs': () => require('../qs'), | ||
'redis': () => require('../redis'), | ||
'restify': () => require('../restify'), | ||
'rhea': () => require('../rhea'), | ||
'router': () => require('../router'), | ||
'sharedb': () => require('../sharedb'), | ||
'sequelize': () => require('../sequelize'), | ||
'tedious': () => require('../tedious'), | ||
'when': () => require('../when'), | ||
'winston': () => require('../winston') | ||
promise: () => require('../promise'), | ||
q: () => require('../q'), | ||
qs: () => require('../qs'), | ||
redis: () => require('../redis'), | ||
restify: () => require('../restify'), | ||
rhea: () => require('../rhea'), | ||
router: () => require('../router'), | ||
sharedb: () => require('../sharedb'), | ||
sequelize: () => require('../sequelize'), | ||
tedious: () => require('../tedious'), | ||
when: () => require('../when'), | ||
winston: () => require('../winston') | ||
} |
@@ -59,3 +59,3 @@ 'use strict' | ||
Object.defineProperties(bound, { | ||
'length': { | ||
length: { | ||
configurable: true, | ||
@@ -66,3 +66,3 @@ enumerable: false, | ||
}, | ||
'asyncResource': { | ||
asyncResource: { | ||
configurable: true, | ||
@@ -69,0 +69,0 @@ enumerable: true, |
@@ -158,2 +158,3 @@ 'use strict' | ||
} catch (e) { | ||
// eslint-disable-next-line n/no-deprecated-api | ||
return url.parse(inputURL) | ||
@@ -160,0 +161,0 @@ } |
@@ -13,3 +13,3 @@ 'use strict' | ||
getTestParametersString, | ||
EFD_STRING, | ||
addEfdStringToTestName, | ||
removeEfdStringFromTestName | ||
@@ -67,7 +67,7 @@ } = require('../../dd-trace/src/plugins/util/test') | ||
const specStatusToTestStatus = { | ||
'pending': 'skip', | ||
'disabled': 'skip', | ||
'todo': 'skip', | ||
'passed': 'pass', | ||
'failed': 'fail' | ||
pending: 'skip', | ||
disabled: 'skip', | ||
todo: 'skip', | ||
passed: 'pass', | ||
failed: 'fail' | ||
} | ||
@@ -106,6 +106,2 @@ | ||
function getEfdTestName (testName, numAttempt) { | ||
return `${EFD_STRING} (#${numAttempt}): ${testName}` | ||
} | ||
function getWrappedEnvironment (BaseEnvironment, jestVersion) { | ||
@@ -162,3 +158,4 @@ return class DatadogEnvironment extends BaseEnvironment { | ||
const describeSuffix = getJestTestName(state.currentDescribeBlock) | ||
return removeEfdStringFromTestName(`${describeSuffix} ${event.testName}`).trim() | ||
const fullTestName = describeSuffix ? `${describeSuffix} ${event.testName}` : event.testName | ||
return removeEfdStringFromTestName(fullTestName) | ||
} | ||
@@ -204,3 +201,2 @@ | ||
} | ||
asyncResource.runInAsyncScope(() => { | ||
@@ -231,3 +227,3 @@ testStartCh.publish({ | ||
if (this.global.test) { | ||
this.global.test(getEfdTestName(event.testName, retryIndex), event.fn, event.timeout) | ||
this.global.test(addEfdStringToTestName(event.testName, retryIndex), event.fn, event.timeout) | ||
} else { | ||
@@ -414,2 +410,5 @@ log.error('Early flake detection could not retry test because global.test is undefined') | ||
knownTests = receivedKnownTests | ||
} else { | ||
// We disable EFD if there has been an error in the known tests request | ||
isEarlyFlakeDetectionEnabled = false | ||
} | ||
@@ -416,0 +415,0 @@ } catch (err) { |
@@ -41,3 +41,4 @@ 'use strict' | ||
this._brokers = (options.brokers && typeof options.brokers !== 'function') | ||
? options.brokers.join(',') : undefined | ||
? options.brokers.join(',') | ||
: undefined | ||
} | ||
@@ -44,0 +45,0 @@ } |
@@ -79,4 +79,5 @@ 'use strict' | ||
const callback = arguments[callbackIndex] | ||
// eslint-disable-next-line n/handle-callback-err | ||
arguments[callbackIndex] = shimmer.wrap(callback, function (err, corkedEmitter) { | ||
if (typeof corkedEmitter === 'object' && typeof corkedEmitter['on'] === 'function') { | ||
if (typeof corkedEmitter === 'object' && typeof corkedEmitter.on === 'function') { | ||
wrapEmitter(corkedEmitter) | ||
@@ -83,0 +84,0 @@ } |
@@ -486,3 +486,3 @@ const { createCoverageMap } = require('istanbul-lib-coverage') | ||
if (this.options.parallel) { | ||
log.warn(`Unable to initialize CI Visibility because Mocha is running in parallel mode.`) | ||
log.warn('Unable to initialize CI Visibility because Mocha is running in parallel mode.') | ||
return run.apply(this, arguments) | ||
@@ -489,0 +489,0 @@ } |
@@ -10,5 +10,5 @@ 'use strict' | ||
const startCh = channel(`apm:mongodb:query:start`) | ||
const finishCh = channel(`apm:mongodb:query:finish`) | ||
const errorCh = channel(`apm:mongodb:query:error`) | ||
const startCh = channel('apm:mongodb:query:start') | ||
const finishCh = channel('apm:mongodb:query:finish') | ||
const errorCh = channel('apm:mongodb:query:error') | ||
@@ -15,0 +15,0 @@ addHook({ name: 'mongodb-core', versions: ['2 - 3.1.9'] }, Server => { |
@@ -18,3 +18,3 @@ 'use strict' | ||
const connectionCh = channel(`apm:net:tcp:connection`) | ||
const connectionCh = channel('apm:net:tcp:connection') | ||
@@ -21,0 +21,0 @@ const names = ['net', 'node:net'] |
@@ -13,2 +13,3 @@ 'use strict' | ||
// eslint-disable-next-line n/handle-callback-err | ||
return shimmer.wrap(verified, function (err, user, info) { | ||
@@ -15,0 +16,0 @@ const credentials = { type, username } |
@@ -39,3 +39,3 @@ const semver = require('semver') | ||
let earlyFlakeDetectionNumRetries = 0 | ||
let knownTests = [] | ||
let knownTests = {} | ||
let rootDir = '' | ||
@@ -411,2 +411,4 @@ const MINIMUM_SUPPORTED_VERSION_EFD = '1.38.0' | ||
knownTests = receivedKnownTests | ||
} else { | ||
isEarlyFlakeDetectionEnabled = false | ||
} | ||
@@ -439,3 +441,7 @@ } catch (err) { | ||
testSessionAsyncResource.runInAsyncScope(() => { | ||
testSessionFinishCh.publish({ status: STATUS_TO_TEST_STATUS[sessionStatus], onDone }) | ||
testSessionFinishCh.publish({ | ||
status: STATUS_TO_TEST_STATUS[sessionStatus], | ||
isEarlyFlakeDetectionEnabled, | ||
onDone | ||
}) | ||
}) | ||
@@ -442,0 +448,0 @@ await flushWait |
@@ -48,3 +48,5 @@ 'use strict' | ||
const targetAddress = this.options && this.options.target && | ||
this.options.target.address ? this.options.target.address : undefined | ||
this.options.target.address | ||
? this.options.target.address | ||
: undefined | ||
@@ -191,3 +193,4 @@ const asyncResource = new AsyncResource('bound-anonymous-fn') | ||
const state = remoteState && remoteState.constructor | ||
? entry.remote_state.constructor.composite_type : undefined | ||
? entry.remote_state.constructor.composite_type | ||
: undefined | ||
asyncResource.runInAsyncScope(() => { | ||
@@ -194,0 +197,0 @@ exports.beforeFinish(entry, state) |
@@ -10,3 +10,3 @@ 'use strict' | ||
addHook({ name: 'tedious', versions: [ '>=1.0.0' ] }, tedious => { | ||
addHook({ name: 'tedious', versions: ['>=1.0.0'] }, tedious => { | ||
const startCh = channel('apm:tedious:request:start') | ||
@@ -13,0 +13,0 @@ const finishCh = channel('apm:tedious:request:finish') |
@@ -25,3 +25,3 @@ 'use strict' | ||
if (serviceName) { spanData.meta['serviceName'] = serviceName } | ||
if (serviceName) { spanData.meta.serviceName = serviceName } | ||
@@ -28,0 +28,0 @@ const span = this.startSpan(this.getOperationName(), spanData, false) |
@@ -1,2 +0,1 @@ | ||
'use strict' | ||
@@ -3,0 +2,0 @@ |
@@ -17,13 +17,2 @@ 'use strict' | ||
constructor (...args) { | ||
super(...args) | ||
this.addSub('apm:apollo:gateway:request:executor', (ctx) => { | ||
if (ctx.requestContext || ctx.gateway) { | ||
this.requestContext = ctx | ||
} else { | ||
this.requestContext = {} | ||
} | ||
}) | ||
} | ||
bindStart (ctx) { | ||
@@ -41,3 +30,3 @@ const store = storage.getStore() | ||
const { requestContext, gateway } = this.requestContext | ||
const { requestContext, gateway } = ctx | ||
@@ -59,3 +48,3 @@ if (requestContext?.operationName) { | ||
spanData['resource'] = getSignature(document, name, type, this?.config?.signature) | ||
spanData.resource = getSignature(document, name, type, this?.config?.signature) | ||
spanData.meta['graphql.operation.type'] = type | ||
@@ -82,6 +71,2 @@ } | ||
} | ||
end () { | ||
// do nothing to avoid ApolloBasePlugin's end method | ||
} | ||
} | ||
@@ -88,0 +73,0 @@ |
@@ -13,7 +13,11 @@ 'use strict' | ||
const result = ctx.result | ||
const span = ctx.currentStore?.span | ||
if (!span) return | ||
if (result instanceof Array && | ||
result[result.length - 1] && result[result.length - 1].stack && result[result.length - 1].message) { | ||
ctx.currentStore.span.setTag('error', result[result.length - 1]) | ||
span.setTag('error', result[result.length - 1]) | ||
} | ||
ctx.currentStore.span.finish() | ||
span.finish() | ||
} | ||
@@ -20,0 +24,0 @@ } |
@@ -40,6 +40,6 @@ 'use strict' | ||
'aws.region': awsRegion, | ||
'region': awsRegion, | ||
'aws_service': awsService, | ||
region: awsRegion, | ||
aws_service: awsService, | ||
'aws.service': awsService, | ||
'component': 'aws-sdk' | ||
component: 'aws-sdk' | ||
} | ||
@@ -46,0 +46,0 @@ if (this.requestTags) this.requestTags.set(request, tags) |
@@ -16,3 +16,3 @@ 'use strict' | ||
'aws.cloudwatch.logs.log_group_name': params.logGroupName, | ||
'loggroupname': params.logGroupName | ||
loggroupname: params.logGroupName | ||
}) | ||
@@ -19,0 +19,0 @@ } |
@@ -17,3 +17,3 @@ 'use strict' | ||
'aws.dynamodb.table_name': params.TableName, | ||
'tablename': params.TableName | ||
tablename: params.TableName | ||
}) | ||
@@ -34,3 +34,3 @@ } | ||
'aws.dynamodb.table_name': tableName, | ||
'tablename': tableName | ||
tablename: tableName | ||
}) | ||
@@ -37,0 +37,0 @@ } |
@@ -14,3 +14,3 @@ 'use strict' | ||
'aws.eventbridge.source': `${params.source}`, | ||
'rulename': `${rulename}` | ||
rulename: `${rulename}` | ||
} | ||
@@ -17,0 +17,0 @@ } |
@@ -72,3 +72,3 @@ 'use strict' | ||
'aws.kinesis.stream_name': params.StreamName, | ||
'streamname': params.StreamName | ||
streamname: params.StreamName | ||
} | ||
@@ -75,0 +75,0 @@ } |
@@ -16,3 +16,3 @@ 'use strict' | ||
'resource.name': `${operation} ${params.FunctionName}`, | ||
'functionname': params.FunctionName, | ||
functionname: params.FunctionName, | ||
'aws.lambda': params.FunctionName | ||
@@ -19,0 +19,0 @@ }) |
@@ -16,3 +16,3 @@ 'use strict' | ||
'aws.redshift.cluster_identifier': params.ClusterIdentifier, | ||
'clusteridentifier': params.ClusterIdentifier | ||
clusteridentifier: params.ClusterIdentifier | ||
}) | ||
@@ -19,0 +19,0 @@ } |
@@ -17,3 +17,3 @@ 'use strict' | ||
'aws.s3.bucket_name': params.Bucket, | ||
'bucketname': params.Bucket | ||
bucketname: params.Bucket | ||
}) | ||
@@ -20,0 +20,0 @@ } |
@@ -26,3 +26,3 @@ 'use strict' | ||
'aws.sns.topic_arn': TopicArn, | ||
'topicname': topicName | ||
topicname: topicName | ||
} | ||
@@ -29,0 +29,0 @@ |
@@ -104,3 +104,3 @@ 'use strict' | ||
'aws.sqs.queue_name': params.QueueName || params.QueueUrl, | ||
'queuename': queueName | ||
queuename: queueName | ||
}) | ||
@@ -150,3 +150,3 @@ | ||
datadogContext: this.tracer.extract('text_map', parsedAttributes), | ||
parsedAttributes: parsedAttributes | ||
parsedAttributes | ||
} | ||
@@ -153,0 +153,0 @@ } |
@@ -48,3 +48,3 @@ 'use strict' | ||
const meta = { | ||
'component': 'subprocess', | ||
component: 'subprocess', | ||
[property]: (shell === true) ? cmdFields.join(' ') : JSON.stringify(cmdFields) | ||
@@ -51,0 +51,0 @@ } |
@@ -19,3 +19,3 @@ 'use strict' | ||
'db.type': 'couchbase', | ||
'component': 'couchbase', | ||
component: 'couchbase', | ||
'resource.name': `couchbase.${operation}`, | ||
@@ -65,2 +65,3 @@ 'span.kind': this.constructor.kind, | ||
} | ||
_addCommandSubs (name) { | ||
@@ -67,0 +68,0 @@ this.addSubs(name, ({ bucket, collection, seedNodes }) => { |
@@ -330,2 +330,3 @@ const { | ||
log.error(knownTestsResponse.err) | ||
this.isEarlyFlakeDetectionEnabled = false | ||
} else { | ||
@@ -332,0 +333,0 @@ // We use TEST_FRAMEWORK_NAME for the name of the module |
@@ -7,3 +7,3 @@ 'use strict' | ||
static get id () { return 'fetch' } | ||
static get prefix () { return `apm:fetch:request` } | ||
static get prefix () { return 'apm:fetch:request' } | ||
@@ -10,0 +10,0 @@ addTraceSub (eventName, handler) { |
@@ -129,3 +129,3 @@ 'use strict' | ||
const argList = {} | ||
for (const argument of directive['arguments']) { | ||
for (const argument of directive.arguments) { | ||
argList[argument.name.value] = argument.value.value | ||
@@ -132,0 +132,0 @@ } |
@@ -11,3 +11,3 @@ 'use strict' | ||
static get operation () { return 'client:request' } | ||
static get prefix () { return `apm:grpc:client:request` } | ||
static get prefix () { return 'apm:grpc:client:request' } | ||
static get peerServicePrecursors () { return ['rpc.service'] } | ||
@@ -34,3 +34,3 @@ | ||
meta: { | ||
'component': 'grpc', | ||
component: 'grpc', | ||
'grpc.method.kind': method.kind, | ||
@@ -37,0 +37,0 @@ 'grpc.method.path': method.path, |
@@ -11,3 +11,3 @@ 'use strict' | ||
static get operation () { return 'server:request' } | ||
static get prefix () { return `apm:grpc:server:request` } | ||
static get prefix () { return 'apm:grpc:server:request' } | ||
@@ -43,3 +43,3 @@ constructor (...args) { | ||
meta: { | ||
'component': 'grpc', | ||
component: 'grpc', | ||
'grpc.method.kind': method.kind, | ||
@@ -46,0 +46,0 @@ 'grpc.method.path': method.path, |
@@ -20,3 +20,3 @@ 'use strict' | ||
static get id () { return 'http' } | ||
static get prefix () { return `apm:http:client:request` } | ||
static get prefix () { return 'apm:http:client:request' } | ||
@@ -231,3 +231,3 @@ bindStart (message) { | ||
if ([].concat(headers['authorization']).some(startsWith('AWS4-HMAC-SHA256'))) { | ||
if ([].concat(headers.authorization).some(startsWith('AWS4-HMAC-SHA256'))) { | ||
return true | ||
@@ -234,0 +234,0 @@ } |
@@ -28,3 +28,3 @@ 'use strict' | ||
static get id () { return 'http2' } | ||
static get prefix () { return `apm:http2:client:request` } | ||
static get prefix () { return 'apm:http2:client:request' } | ||
@@ -126,3 +126,4 @@ bindStart (message) { | ||
let port = '' + (authority.port !== '' | ||
? authority.port : (authority.protocol === 'http:' ? 80 : 443)) | ||
? authority.port | ||
: (authority.protocol === 'http:' ? 80 : 443)) | ||
let host = authority.hostname || authority.host || 'localhost' | ||
@@ -149,3 +150,3 @@ | ||
if ([].concat(headers['authorization']).some(startsWith('AWS4-HMAC-SHA256'))) { | ||
if ([].concat(headers.authorization).some(startsWith('AWS4-HMAC-SHA256'))) { | ||
return true | ||
@@ -152,0 +153,0 @@ } |
@@ -54,2 +54,3 @@ const CiPlugin = require('../../dd-trace/src/plugins/ci_plugin') | ||
} | ||
getForcedToRunSuites (forcedToRunSuitesList) { | ||
@@ -56,0 +57,0 @@ if (!this.forcedToRunSuites) { |
@@ -73,3 +73,3 @@ 'use strict' | ||
meta: { | ||
'component': 'kafkajs', | ||
component: 'kafkajs', | ||
'kafka.topic': topic, | ||
@@ -76,0 +76,0 @@ 'kafka.message.offset': message.offset |
@@ -73,3 +73,3 @@ 'use strict' | ||
meta: { | ||
'component': 'kafkajs', | ||
component: 'kafkajs', | ||
'kafka.topic': topic | ||
@@ -76,0 +76,0 @@ }, |
@@ -61,3 +61,3 @@ 'use strict' | ||
const span = store.span | ||
const error = span.context()._tags['error'] | ||
const error = span.context()._tags.error | ||
const requestError = req.error || nextRequest.error | ||
@@ -64,0 +64,0 @@ |
@@ -92,3 +92,3 @@ 'use strict' | ||
// This is a single prompt, either String or [Number] | ||
tags[`openai.request.prompt`] = normalizeStringOrTokenArray(prompt, true) | ||
tags['openai.request.prompt'] = normalizeStringOrTokenArray(prompt, true) | ||
} else if (Array.isArray(prompt)) { | ||
@@ -105,3 +105,3 @@ // This is multiple prompts, either [String] or [[Number]] | ||
const normalized = normalizeStringOrTokenArray(payload.input, false) | ||
tags[`openai.request.input`] = truncateText(normalized) | ||
tags['openai.request.input'] = truncateText(normalized) | ||
store.input = normalized | ||
@@ -208,3 +208,3 @@ } | ||
const tags = [`error:1`] | ||
const tags = ['error:1'] | ||
this.metrics.distribution('openai.request.duration', span._duration * 1000, tags) | ||
@@ -221,3 +221,3 @@ this.metrics.increment('openai.request.error', 1, tags) | ||
`model:${headers['openai-model']}`, | ||
`error:0` | ||
'error:0' | ||
] | ||
@@ -224,0 +224,0 @@ |
@@ -16,3 +16,4 @@ 'use strict' | ||
TEST_IS_NEW, | ||
TEST_IS_RETRY | ||
TEST_IS_RETRY, | ||
TEST_EARLY_FLAKE_IS_ENABLED | ||
} = require('../../dd-trace/src/plugins/util/test') | ||
@@ -39,6 +40,10 @@ const { RESOURCE_NAME } = require('../../../ext/tags') | ||
this.addSub('ci:playwright:session:finish', ({ status, onDone }) => { | ||
this.addSub('ci:playwright:session:finish', ({ status, isEarlyFlakeDetectionEnabled, onDone }) => { | ||
this.testModuleSpan.setTag(TEST_STATUS, status) | ||
this.testSessionSpan.setTag(TEST_STATUS, status) | ||
if (isEarlyFlakeDetectionEnabled) { | ||
this.testSessionSpan.setTag(TEST_EARLY_FLAKE_IS_ENABLED, 'true') | ||
} | ||
if (this.numFailedSuites > 0) { | ||
@@ -45,0 +50,0 @@ let errorMessage = `Test suites failed: ${this.numFailedSuites}.` |
@@ -29,3 +29,3 @@ 'use strict' | ||
meta: { | ||
'component': 'rhea', | ||
component: 'rhea', | ||
'amqp.link.source.address': name, | ||
@@ -32,0 +32,0 @@ 'amqp.link.role': 'receiver' |
@@ -22,3 +22,3 @@ 'use strict' | ||
meta: { | ||
'component': 'rhea', | ||
component: 'rhea', | ||
'amqp.link.target.address': name, | ||
@@ -25,0 +25,0 @@ 'amqp.link.role': 'sender', |
@@ -74,3 +74,3 @@ 'use strict' | ||
this.addSub(`apm:http:server:request:finish`, ({ req }) => { | ||
this.addSub('apm:http:server:request:finish', ({ req }) => { | ||
const context = this._contexts.get(req) | ||
@@ -77,0 +77,0 @@ |
@@ -19,3 +19,3 @@ 'use strict' | ||
'db.type': 'mssql', | ||
'component': 'tedious', | ||
component: 'tedious', | ||
'out.host': connectionConfig.server, | ||
@@ -22,0 +22,0 @@ [CLIENT_PORT_KEY]: connectionConfig.options.port, |
@@ -31,3 +31,3 @@ 'use strict' | ||
const headers = { | ||
'Location': blockingConfiguration.parameters.location | ||
Location: blockingConfiguration.parameters.location | ||
} | ||
@@ -34,0 +34,0 @@ |
'use strict' | ||
module.exports = { | ||
'COMMAND_INJECTION_ANALYZER': require('./command-injection-analyzer'), | ||
'HARCODED_SECRET_ANALYZER': require('./hardcoded-secret-analyzer'), | ||
'HEADER_INJECTION_ANALYZER': require('./header-injection-analyzer'), | ||
'HSTS_HEADER_MISSING_ANALYZER': require('./hsts-header-missing-analyzer'), | ||
'INSECURE_COOKIE_ANALYZER': require('./insecure-cookie-analyzer'), | ||
'LDAP_ANALYZER': require('./ldap-injection-analyzer'), | ||
'NO_HTTPONLY_COOKIE_ANALYZER': require('./no-httponly-cookie-analyzer'), | ||
'NO_SAMESITE_COOKIE_ANALYZER': require('./no-samesite-cookie-analyzer'), | ||
'NOSQL_MONGODB_INJECTION': require('./nosql-injection-mongodb-analyzer'), | ||
'PATH_TRAVERSAL_ANALYZER': require('./path-traversal-analyzer'), | ||
'SQL_INJECTION_ANALYZER': require('./sql-injection-analyzer'), | ||
'SSRF': require('./ssrf-analyzer'), | ||
'UNVALIDATED_REDIRECT_ANALYZER': require('./unvalidated-redirect-analyzer'), | ||
'WEAK_CIPHER_ANALYZER': require('./weak-cipher-analyzer'), | ||
'WEAK_HASH_ANALYZER': require('./weak-hash-analyzer'), | ||
'WEAK_RANDOMNESS_ANALYZER': require('./weak-randomness-analyzer'), | ||
'XCONTENTTYPE_HEADER_MISSING_ANALYZER': require('./xcontenttype-header-missing-analyzer') | ||
COMMAND_INJECTION_ANALYZER: require('./command-injection-analyzer'), | ||
HARCODED_SECRET_ANALYZER: require('./hardcoded-secret-analyzer'), | ||
HEADER_INJECTION_ANALYZER: require('./header-injection-analyzer'), | ||
HSTS_HEADER_MISSING_ANALYZER: require('./hsts-header-missing-analyzer'), | ||
INSECURE_COOKIE_ANALYZER: require('./insecure-cookie-analyzer'), | ||
LDAP_ANALYZER: require('./ldap-injection-analyzer'), | ||
NO_HTTPONLY_COOKIE_ANALYZER: require('./no-httponly-cookie-analyzer'), | ||
NO_SAMESITE_COOKIE_ANALYZER: require('./no-samesite-cookie-analyzer'), | ||
NOSQL_MONGODB_INJECTION: require('./nosql-injection-mongodb-analyzer'), | ||
PATH_TRAVERSAL_ANALYZER: require('./path-traversal-analyzer'), | ||
SQL_INJECTION_ANALYZER: require('./sql-injection-analyzer'), | ||
SSRF: require('./ssrf-analyzer'), | ||
UNVALIDATED_REDIRECT_ANALYZER: require('./unvalidated-redirect-analyzer'), | ||
WEAK_CIPHER_ANALYZER: require('./weak-cipher-analyzer'), | ||
WEAK_HASH_ANALYZER: require('./weak-hash-analyzer'), | ||
WEAK_RANDOMNESS_ANALYZER: require('./weak-randomness-analyzer'), | ||
XCONTENTTYPE_HEADER_MISSING_ANALYZER: require('./xcontenttype-header-missing-analyzer') | ||
} |
@@ -37,2 +37,3 @@ 'use strict' | ||
} | ||
_checkOCE (context, value) { | ||
@@ -39,0 +40,0 @@ if (value && value.location) { |
@@ -6,265 +6,265 @@ /* eslint-disable max-len */ | ||
{ | ||
'id': 'adobe-client-secret', | ||
'regex': /\b((p8e-)[a-z0-9]{32})(?:['"\s\x60;]|$)/i | ||
id: 'adobe-client-secret', | ||
regex: /\b((p8e-)[a-z0-9]{32})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'age-secret-key', | ||
'regex': /AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}/ | ||
id: 'age-secret-key', | ||
regex: /AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}/ | ||
}, | ||
{ | ||
'id': 'alibaba-access-key-id', | ||
'regex': /\b((LTAI)[a-z0-9]{20})(?:['"\s\x60;]|$)/i | ||
id: 'alibaba-access-key-id', | ||
regex: /\b((LTAI)[a-z0-9]{20})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'authress-service-client-access-key', | ||
'regex': /\b((?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120})(?:['"\s\x60;]|$)/i | ||
id: 'authress-service-client-access-key', | ||
regex: /\b((?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'aws-access-token', | ||
'regex': /\b((A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16})(?:['"\s\x60;]|$)/ | ||
id: 'aws-access-token', | ||
regex: /\b((A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16})(?:['"\s\x60;]|$)/ | ||
}, | ||
{ | ||
'id': 'clojars-api-token', | ||
'regex': /(CLOJARS_)[a-z0-9]{60}/i | ||
id: 'clojars-api-token', | ||
regex: /(CLOJARS_)[a-z0-9]{60}/i | ||
}, | ||
{ | ||
'id': 'databricks-api-token', | ||
'regex': /\b(dapi[a-h0-9]{32})(?:['"\s\x60;]|$)/i | ||
id: 'databricks-api-token', | ||
regex: /\b(dapi[a-h0-9]{32})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'digitalocean-access-token', | ||
'regex': /\b(doo_v1_[a-f0-9]{64})(?:['"\s\x60;]|$)/i | ||
id: 'digitalocean-access-token', | ||
regex: /\b(doo_v1_[a-f0-9]{64})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'digitalocean-pat', | ||
'regex': /\b(dop_v1_[a-f0-9]{64})(?:['"\s\x60;]|$)/i | ||
id: 'digitalocean-pat', | ||
regex: /\b(dop_v1_[a-f0-9]{64})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'digitalocean-refresh-token', | ||
'regex': /\b(dor_v1_[a-f0-9]{64})(?:['"\s\x60;]|$)/i | ||
id: 'digitalocean-refresh-token', | ||
regex: /\b(dor_v1_[a-f0-9]{64})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'doppler-api-token', | ||
'regex': /(dp\.pt\.)[a-z0-9]{43}/i | ||
id: 'doppler-api-token', | ||
regex: /(dp\.pt\.)[a-z0-9]{43}/i | ||
}, | ||
{ | ||
'id': 'duffel-api-token', | ||
'regex': /duffel_(test|live)_[a-z0-9_\-=]{43}/i | ||
id: 'duffel-api-token', | ||
regex: /duffel_(test|live)_[a-z0-9_\-=]{43}/i | ||
}, | ||
{ | ||
'id': 'dynatrace-api-token', | ||
'regex': /dt0c01\.[a-z0-9]{24}\.[a-z0-9]{64}/i | ||
id: 'dynatrace-api-token', | ||
regex: /dt0c01\.[a-z0-9]{24}\.[a-z0-9]{64}/i | ||
}, | ||
{ | ||
'id': 'easypost-api-token', | ||
'regex': /\bEZAK[a-z0-9]{54}/i | ||
id: 'easypost-api-token', | ||
regex: /\bEZAK[a-z0-9]{54}/i | ||
}, | ||
{ | ||
'id': 'flutterwave-public-key', | ||
'regex': /FLWPUBK_TEST-[a-h0-9]{32}-X/i | ||
id: 'flutterwave-public-key', | ||
regex: /FLWPUBK_TEST-[a-h0-9]{32}-X/i | ||
}, | ||
{ | ||
'id': 'frameio-api-token', | ||
'regex': /fio-u-[a-z0-9\-_=]{64}/i | ||
id: 'frameio-api-token', | ||
regex: /fio-u-[a-z0-9\-_=]{64}/i | ||
}, | ||
{ | ||
'id': 'gcp-api-key', | ||
'regex': /\b(AIza[0-9a-z\-_]{35})(?:['"\s\x60;]|$)/i | ||
id: 'gcp-api-key', | ||
regex: /\b(AIza[0-9a-z\-_]{35})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'github-app-token', | ||
'regex': /(ghu|ghs)_[0-9a-zA-Z]{36}/ | ||
id: 'github-app-token', | ||
regex: /(ghu|ghs)_[0-9a-zA-Z]{36}/ | ||
}, | ||
{ | ||
'id': 'github-fine-grained-pat', | ||
'regex': /github_pat_[0-9a-zA-Z_]{82}/ | ||
id: 'github-fine-grained-pat', | ||
regex: /github_pat_[0-9a-zA-Z_]{82}/ | ||
}, | ||
{ | ||
'id': 'github-oauth', | ||
'regex': /gho_[0-9a-zA-Z]{36}/ | ||
id: 'github-oauth', | ||
regex: /gho_[0-9a-zA-Z]{36}/ | ||
}, | ||
{ | ||
'id': 'github-pat', | ||
'regex': /ghp_[0-9a-zA-Z]{36}/ | ||
id: 'github-pat', | ||
regex: /ghp_[0-9a-zA-Z]{36}/ | ||
}, | ||
{ | ||
'id': 'gitlab-pat', | ||
'regex': /glpat-[0-9a-zA-Z\-_]{20}/ | ||
id: 'gitlab-pat', | ||
regex: /glpat-[0-9a-zA-Z\-_]{20}/ | ||
}, | ||
{ | ||
'id': 'gitlab-ptt', | ||
'regex': /glptt-[0-9a-f]{40}/ | ||
id: 'gitlab-ptt', | ||
regex: /glptt-[0-9a-f]{40}/ | ||
}, | ||
{ | ||
'id': 'gitlab-rrt', | ||
'regex': /GR1348941[0-9a-zA-Z\-_]{20}/ | ||
id: 'gitlab-rrt', | ||
regex: /GR1348941[0-9a-zA-Z\-_]{20}/ | ||
}, | ||
{ | ||
'id': 'grafana-api-key', | ||
'regex': /\b(eyJrIjoi[a-z0-9]{70,400}={0,2})(?:['"\s\x60;]|$)/i | ||
id: 'grafana-api-key', | ||
regex: /\b(eyJrIjoi[a-z0-9]{70,400}={0,2})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'grafana-cloud-api-token', | ||
'regex': /\b(glc_[a-z0-9+/]{32,400}={0,2})(?:['"\s\x60;]|$)/i | ||
id: 'grafana-cloud-api-token', | ||
regex: /\b(glc_[a-z0-9+/]{32,400}={0,2})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'grafana-service-account-token', | ||
'regex': /\b(glsa_[a-z0-9]{32}_[a-f0-9]{8})(?:['"\s\x60;]|$)/i | ||
id: 'grafana-service-account-token', | ||
regex: /\b(glsa_[a-z0-9]{32}_[a-f0-9]{8})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'hashicorp-tf-api-token', | ||
'regex': /[a-z0-9]{14}\.atlasv1\.[a-z0-9\-_=]{60,70}/i | ||
id: 'hashicorp-tf-api-token', | ||
regex: /[a-z0-9]{14}\.atlasv1\.[a-z0-9\-_=]{60,70}/i | ||
}, | ||
{ | ||
'id': 'jwt', | ||
'regex': /\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9/_-]{17,}\.(?:[a-zA-Z0-9/_-]{10,}={0,2})?)(?:['"\s\x60;]|$)/ | ||
id: 'jwt', | ||
regex: /\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9/_-]{17,}\.(?:[a-zA-Z0-9/_-]{10,}={0,2})?)(?:['"\s\x60;]|$)/ | ||
}, | ||
{ | ||
'id': 'linear-api-key', | ||
'regex': /lin_api_[a-z0-9]{40}/i | ||
id: 'linear-api-key', | ||
regex: /lin_api_[a-z0-9]{40}/i | ||
}, | ||
{ | ||
'id': 'npm-access-token', | ||
'regex': /\b(npm_[a-z0-9]{36})(?:['"\s\x60;]|$)/i | ||
id: 'npm-access-token', | ||
regex: /\b(npm_[a-z0-9]{36})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'openai-api-key', | ||
'regex': /\b(sk-[a-z0-9]{20}T3BlbkFJ[a-z0-9]{20})(?:['"\s\x60;]|$)/i | ||
id: 'openai-api-key', | ||
regex: /\b(sk-[a-z0-9]{20}T3BlbkFJ[a-z0-9]{20})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'planetscale-api-token', | ||
'regex': /\b(pscale_tkn_[a-z0-9=\-_.]{32,64})(?:['"\s\x60;]|$)/i | ||
id: 'planetscale-api-token', | ||
regex: /\b(pscale_tkn_[a-z0-9=\-_.]{32,64})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'planetscale-oauth-token', | ||
'regex': /\b(pscale_oauth_[a-z0-9=\-_.]{32,64})(?:['"\s\x60;]|$)/i | ||
id: 'planetscale-oauth-token', | ||
regex: /\b(pscale_oauth_[a-z0-9=\-_.]{32,64})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'planetscale-password', | ||
'regex': /\b(pscale_pw_[a-z0-9=\-_.]{32,64})(?:['"\s\x60;]|$)/i | ||
id: 'planetscale-password', | ||
regex: /\b(pscale_pw_[a-z0-9=\-_.]{32,64})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'postman-api-token', | ||
'regex': /\b(PMAK-[a-f0-9]{24}-[a-f0-9]{34})(?:['"\s\x60;]|$)/i | ||
id: 'postman-api-token', | ||
regex: /\b(PMAK-[a-f0-9]{24}-[a-f0-9]{34})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'prefect-api-token', | ||
'regex': /\b(pnu_[a-z0-9]{36})(?:['"\s\x60;]|$)/i | ||
id: 'prefect-api-token', | ||
regex: /\b(pnu_[a-z0-9]{36})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'private-key', | ||
'regex': /-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S]*KEY( BLOCK)?----/i | ||
id: 'private-key', | ||
regex: /-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S]*KEY( BLOCK)?----/i | ||
}, | ||
{ | ||
'id': 'pulumi-api-token', | ||
'regex': /\b(pul-[a-f0-9]{40})(?:['"\s\x60;]|$)/i | ||
id: 'pulumi-api-token', | ||
regex: /\b(pul-[a-f0-9]{40})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'pypi-upload-token', | ||
'regex': /pypi-AgEIcHlwaS5vcmc[A-Za-z0-9\-_]{50,1000}/ | ||
id: 'pypi-upload-token', | ||
regex: /pypi-AgEIcHlwaS5vcmc[A-Za-z0-9\-_]{50,1000}/ | ||
}, | ||
{ | ||
'id': 'readme-api-token', | ||
'regex': /\b(rdme_[a-z0-9]{70})(?:['"\s\x60;]|$)/i | ||
id: 'readme-api-token', | ||
regex: /\b(rdme_[a-z0-9]{70})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'rubygems-api-token', | ||
'regex': /\b(rubygems_[a-f0-9]{48})(?:['"\s\x60;]|$)/i | ||
id: 'rubygems-api-token', | ||
regex: /\b(rubygems_[a-f0-9]{48})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'scalingo-api-token', | ||
'regex': /tk-us-[a-zA-Z0-9-_]{48}/ | ||
id: 'scalingo-api-token', | ||
regex: /tk-us-[a-zA-Z0-9-_]{48}/ | ||
}, | ||
{ | ||
'id': 'sendgrid-api-token', | ||
'regex': /\b(SG\.[a-z0-9=_\-.]{66})(?:['"\s\x60;]|$)/i | ||
id: 'sendgrid-api-token', | ||
regex: /\b(SG\.[a-z0-9=_\-.]{66})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'sendinblue-api-token', | ||
'regex': /\b(xkeysib-[a-f0-9]{64}-[a-z0-9]{16})(?:['"\s\x60;]|$)/i | ||
id: 'sendinblue-api-token', | ||
regex: /\b(xkeysib-[a-f0-9]{64}-[a-z0-9]{16})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'shippo-api-token', | ||
'regex': /\b(shippo_(live|test)_[a-f0-9]{40})(?:['"\s\x60;]|$)/i | ||
id: 'shippo-api-token', | ||
regex: /\b(shippo_(live|test)_[a-f0-9]{40})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'shopify-access-token', | ||
'regex': /shpat_[a-fA-F0-9]{32}/ | ||
id: 'shopify-access-token', | ||
regex: /shpat_[a-fA-F0-9]{32}/ | ||
}, | ||
{ | ||
'id': 'shopify-custom-access-token', | ||
'regex': /shpca_[a-fA-F0-9]{32}/ | ||
id: 'shopify-custom-access-token', | ||
regex: /shpca_[a-fA-F0-9]{32}/ | ||
}, | ||
{ | ||
'id': 'shopify-private-app-access-token', | ||
'regex': /shppa_[a-fA-F0-9]{32}/ | ||
id: 'shopify-private-app-access-token', | ||
regex: /shppa_[a-fA-F0-9]{32}/ | ||
}, | ||
{ | ||
'id': 'shopify-shared-secret', | ||
'regex': /shpss_[a-fA-F0-9]{32}/ | ||
id: 'shopify-shared-secret', | ||
regex: /shpss_[a-fA-F0-9]{32}/ | ||
}, | ||
{ | ||
'id': 'slack-app-token', | ||
'regex': /(xapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+)/i | ||
id: 'slack-app-token', | ||
regex: /(xapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+)/i | ||
}, | ||
{ | ||
'id': 'slack-bot-token', | ||
'regex': /(xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*)/ | ||
id: 'slack-bot-token', | ||
regex: /(xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*)/ | ||
}, | ||
{ | ||
'id': 'slack-config-access-token', | ||
'regex': /(xoxe.xox[bp]-\d-[A-Z0-9]{163,166})/i | ||
id: 'slack-config-access-token', | ||
regex: /(xoxe.xox[bp]-\d-[A-Z0-9]{163,166})/i | ||
}, | ||
{ | ||
'id': 'slack-config-refresh-token', | ||
'regex': /(xoxe-\d-[A-Z0-9]{146})/i | ||
id: 'slack-config-refresh-token', | ||
regex: /(xoxe-\d-[A-Z0-9]{146})/i | ||
}, | ||
{ | ||
'id': 'slack-legacy-bot-token', | ||
'regex': /(xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26})/ | ||
id: 'slack-legacy-bot-token', | ||
regex: /(xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26})/ | ||
}, | ||
{ | ||
'id': 'slack-legacy-token', | ||
'regex': /(xox[os]-\d+-\d+-\d+-[a-fA-F\d]+)/ | ||
id: 'slack-legacy-token', | ||
regex: /(xox[os]-\d+-\d+-\d+-[a-fA-F\d]+)/ | ||
}, | ||
{ | ||
'id': 'slack-legacy-workspace-token', | ||
'regex': /(xox[ar]-(?:\d-)?[0-9a-zA-Z]{8,48})/ | ||
id: 'slack-legacy-workspace-token', | ||
regex: /(xox[ar]-(?:\d-)?[0-9a-zA-Z]{8,48})/ | ||
}, | ||
{ | ||
'id': 'slack-user-token', | ||
'regex': /(xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34})/ | ||
id: 'slack-user-token', | ||
regex: /(xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34})/ | ||
}, | ||
{ | ||
'id': 'slack-webhook-url', | ||
'regex': /(https?:\/\/)?hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+/]{43,46}/ | ||
id: 'slack-webhook-url', | ||
regex: /(https?:\/\/)?hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+/]{43,46}/ | ||
}, | ||
{ | ||
'id': 'square-access-token', | ||
'regex': /\b(sq0atp-[0-9a-z\-_]{22})(?:['"\s\x60;]|$)/i | ||
id: 'square-access-token', | ||
regex: /\b(sq0atp-[0-9a-z\-_]{22})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'square-secret', | ||
'regex': /\b(sq0csp-[0-9a-z\-_]{43})(?:['"\s\x60;]|$)/i | ||
id: 'square-secret', | ||
regex: /\b(sq0csp-[0-9a-z\-_]{43})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'stripe-access-token', | ||
'regex': /(sk|pk)_(test|live)_[0-9a-z]{10,32}/i | ||
id: 'stripe-access-token', | ||
regex: /(sk|pk)_(test|live)_[0-9a-z]{10,32}/i | ||
}, | ||
{ | ||
'id': 'telegram-bot-api-token', | ||
'regex': /(?:^|[^0-9])([0-9]{5,16}:A[a-z0-9_-]{34})(?:$|[^a-z0-9_-])/i | ||
id: 'telegram-bot-api-token', | ||
regex: /(?:^|[^0-9])([0-9]{5,16}:A[a-z0-9_-]{34})(?:$|[^a-z0-9_-])/i | ||
}, | ||
{ | ||
'id': 'twilio-api-key', | ||
'regex': /SK[0-9a-fA-F]{32}/ | ||
id: 'twilio-api-key', | ||
regex: /SK[0-9a-fA-F]{32}/ | ||
}, | ||
{ | ||
'id': 'vault-batch-token', | ||
'regex': /\b(hvb\.[a-z0-9_-]{138,212})(?:['"\s\x60;]|$)/i | ||
id: 'vault-batch-token', | ||
regex: /\b(hvb\.[a-z0-9_-]{138,212})(?:['"\s\x60;]|$)/i | ||
}, | ||
{ | ||
'id': 'vault-service-token', | ||
'regex': /\b(hvs\.[a-z0-9_-]{90,100})(?:['"\s\x60;]|$)/i | ||
id: 'vault-service-token', | ||
regex: /\b(hvs\.[a-z0-9_-]{90,100})(?:['"\s\x60;]|$)/i | ||
} | ||
] |
@@ -12,2 +12,3 @@ 'use strict' | ||
} | ||
_isVulnerableFromRequestAndResponse (req, res) { | ||
@@ -14,0 +15,0 @@ const headerValues = this._getHeaderValues(res, HSTS_HEADER_NAME) |
@@ -15,3 +15,3 @@ 'use strict' | ||
function iterateObjectStrings (target, fn, levelKeys = [], depth = 50, visited = new Set()) { | ||
function iterateObjectStrings (target, fn, levelKeys = [], depth = 20, visited = new Set()) { | ||
if (target && typeof target === 'object') { | ||
@@ -18,0 +18,0 @@ Object.keys(target).forEach((key) => { |
@@ -57,3 +57,4 @@ 'use strict' | ||
const sampling = config && typeof config.requestSampling === 'number' | ||
? config.requestSampling : 30 | ||
? config.requestSampling | ||
: 30 | ||
if (rootSpan.context().toSpanId().slice(-2) <= sampling) { | ||
@@ -60,0 +61,0 @@ availableRequest-- |
@@ -36,6 +36,6 @@ 'use strict' | ||
}, | ||
setMaxTransactions: setMaxTransactions, | ||
createTransaction: createTransaction, | ||
removeTransaction: removeTransaction, | ||
setMaxTransactions, | ||
createTransaction, | ||
removeTransaction, | ||
taintTrackingPlugin | ||
} |
@@ -33,5 +33,5 @@ 'use strict' | ||
const iastContext = getIastContext(storage.getStore()) | ||
if (iastContext && iastContext['body'] !== req.body) { | ||
if (iastContext && iastContext.body !== req.body) { | ||
this._taintTrackingHandler(HTTP_REQUEST_BODY, req, 'body', iastContext) | ||
iastContext['body'] = req.body | ||
iastContext.body = req.body | ||
} | ||
@@ -51,5 +51,5 @@ } | ||
const iastContext = getIastContext(storage.getStore()) | ||
if (iastContext && iastContext['body'] !== req.body) { | ||
if (iastContext && iastContext.body !== req.body) { | ||
this._taintTrackingHandler(HTTP_REQUEST_BODY, req, 'body', iastContext) | ||
iastContext['body'] = req.body | ||
iastContext.body = req.body | ||
} | ||
@@ -56,0 +56,0 @@ } |
@@ -110,3 +110,3 @@ 'use strict' | ||
} catch (e) { | ||
iastLog.error(`Error invoking CSI plusOperator`) | ||
iastLog.error('Error invoking CSI plusOperator') | ||
.errorAndPublish(e) | ||
@@ -113,0 +113,0 @@ } |
@@ -5,4 +5,5 @@ 'use strict' | ||
const { Namespace } = require('../../../telemetry/metrics') | ||
const { addMetricsToSpan, filterTags } = require('./span-tags') | ||
const { addMetricsToSpan } = require('./span-tags') | ||
const { IAST_TRACE_METRIC_PREFIX } = require('../tags') | ||
const iastLog = require('../iast-log') | ||
@@ -28,8 +29,7 @@ const DD_IAST_METRICS_NAMESPACE = Symbol('_dd.iast.request.metrics.namespace') | ||
const metrics = [...namespace.metrics.values()] | ||
namespace.metrics.clear() | ||
addMetricsToSpan(rootSpan, [...namespace.metrics.values()], IAST_TRACE_METRIC_PREFIX) | ||
addMetricsToSpan(rootSpan, metrics, IAST_TRACE_METRIC_PREFIX) | ||
merge(namespace) | ||
merge(metrics) | ||
namespace.clear() | ||
} catch (e) { | ||
@@ -44,16 +44,12 @@ log.error(e) | ||
function merge (metrics) { | ||
metrics.forEach(metric => { | ||
const { metric: metricName, type, tags, points } = metric | ||
function merge (namespace) { | ||
for (const [metricName, metricsByTagMap] of namespace.iastMetrics) { | ||
for (const [tags, metric] of metricsByTagMap) { | ||
const { type, points } = metric | ||
if (points?.length && type === 'count') { | ||
const gMetric = globalNamespace.count(metricName, getTagsObject(tags)) | ||
points.forEach(point => gMetric.inc(point[1])) | ||
if (points?.length && type === 'count') { | ||
const gMetric = globalNamespace.getMetric(metricName, tags) | ||
points.forEach(point => gMetric.inc(point[1])) | ||
} | ||
} | ||
}) | ||
} | ||
function getTagsObject (tags) { | ||
if (tags && tags.length > 0) { | ||
return filterTags(tags) | ||
} | ||
@@ -63,5 +59,6 @@ } | ||
class IastNamespace extends Namespace { | ||
constructor () { | ||
constructor (maxMetricTagsSize = 100) { | ||
super('iast') | ||
this.maxMetricTagsSize = maxMetricTagsSize | ||
this.iastMetrics = new Map() | ||
@@ -86,2 +83,8 @@ } | ||
metric = super[type](name, Array.isArray(tags) ? [...tags] : tags) | ||
if (metrics.size === this.maxMetricTagsSize) { | ||
metrics.clear() | ||
iastLog.warnAndPublish(`Tags cache max size reached for metric ${name}`) | ||
} | ||
metrics.set(tags, metric) | ||
@@ -96,2 +99,8 @@ } | ||
} | ||
clear () { | ||
this.iastMetrics.clear() | ||
this.distributions.clear() | ||
this.metrics.clear() | ||
} | ||
} | ||
@@ -98,0 +107,0 @@ |
@@ -43,3 +43,3 @@ 'use strict' | ||
function filterTags (tags) { | ||
return tags?.filter(tag => !tag.startsWith('lib_language') && !tag.startsWith('version')) | ||
return tags?.filter(tag => !tag.startsWith('version')) | ||
} | ||
@@ -46,0 +46,0 @@ |
@@ -71,3 +71,3 @@ 'use strict' | ||
if (!pattern) { | ||
pattern = patterns['ANSI'] | ||
pattern = patterns.ANSI | ||
} | ||
@@ -74,0 +74,0 @@ pattern.lastIndex = 0 |
@@ -16,3 +16,3 @@ 'use strict' | ||
function iterateObject (target, fn, levelKeys = [], depth = 50) { | ||
function iterateObject (target, fn, levelKeys = [], depth = 10, visited = new Set()) { | ||
Object.keys(target).forEach((key) => { | ||
@@ -22,6 +22,9 @@ const nextLevelKeys = [...levelKeys, key] | ||
fn(val, nextLevelKeys, target, key) | ||
if (typeof val !== 'object' || !visited.has(val)) { | ||
visited.add(val) | ||
fn(val, nextLevelKeys, target, key) | ||
if (val !== null && typeof val === 'object' && depth > 0) { | ||
iterateObject(val, fn, nextLevelKeys, depth - 1) | ||
if (val !== null && typeof val === 'object' && depth > 0) { | ||
iterateObject(val, fn, nextLevelKeys, depth - 1, visited) | ||
} | ||
} | ||
@@ -28,0 +31,0 @@ }) |
@@ -42,3 +42,3 @@ 'use strict' | ||
if (Object.keys(inputs).length) { | ||
payload['persistent'] = inputs | ||
payload.persistent = inputs | ||
payloadHasData = true | ||
@@ -48,3 +48,3 @@ } | ||
if (ephemeral && Object.keys(ephemeral).length) { | ||
payload['ephemeral'] = ephemeral | ||
payload.ephemeral = ephemeral | ||
payloadHasData = true | ||
@@ -51,0 +51,0 @@ } |
@@ -1,2 +0,1 @@ | ||
const fs = require('fs') | ||
@@ -3,0 +2,0 @@ const path = require('path') |
@@ -105,3 +105,4 @@ const request = require('../../exporters/common/request') | ||
testLevel === 'test' | ||
? TELEMETRY_ITR_SKIPPABLE_TESTS_RESPONSE_TESTS : TELEMETRY_ITR_SKIPPABLE_TESTS_RESPONSE_SUITES, | ||
? TELEMETRY_ITR_SKIPPABLE_TESTS_RESPONSE_TESTS | ||
: TELEMETRY_ITR_SKIPPABLE_TESTS_RESPONSE_SUITES, | ||
{}, | ||
@@ -108,0 +109,0 @@ skippableSuites.length |
@@ -13,2 +13,3 @@ const CiPlugin = require('../../plugins/ci_plugin') | ||
} | ||
constructor (...args) { | ||
@@ -15,0 +16,0 @@ super(...args) |
@@ -26,9 +26,6 @@ 'use strict' | ||
const qsRegex = '(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:"|%22)(?:%2[^2]|%[^2]|[^"%])+(?:"|%22))|bearer(?:\\s|%20)+[a-z0-9\\._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\\w=-]|%3D)+\\.ey[I-L](?:[\\w=-]|%3D)+(?:\\.(?:[\\w.+\\/=-]|%3D|%2F|%2B)+)?|[\\-]{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY[\\-]{5}[^\\-]+[\\-]{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY|ssh-rsa(?:\\s|%20)*(?:[a-z0-9\\/\\.+]|%2F|%5C|%2B){100,}' | ||
const defaultWafObfuscatorKeyRegex = `(?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?\ | ||
|public_?)key)|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)|bearer|authorization` | ||
const defaultWafObfuscatorValueRegex = | ||
`(?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|to\ | ||
ken|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:\\s*=[^;]|"\\s*:\\s*"[^"]+")|bearer\ | ||
\\s+[a-z0-9\\._\\-]+|token:[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L][\\w=-]+\\.ey[I-L][\\w=-]+(?:\\.[\\w.+\\/=-]+)?\ | ||
|[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}[^\\-]+[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY|ssh-rsa\\s*[a-z0-9\\/\\.+]{100,}` | ||
// eslint-disable-next-line max-len | ||
const defaultWafObfuscatorKeyRegex = '(?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?)key)|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)|bearer|authorization' | ||
// eslint-disable-next-line max-len | ||
const defaultWafObfuscatorValueRegex = '(?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:\\s*=[^;]|"\\s*:\\s*"[^"]+")|bearer\\s+[a-z0-9\\._\\-]+|token:[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L][\\w=-]+\\.ey[I-L][\\w=-]+(?:\\.[\\w.+\\/=-]+)?|[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}[^\\-]+[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY|ssh-rsa\\s*[a-z0-9\\/\\.+]{100,}' | ||
@@ -136,5 +133,7 @@ function maybeFile (filepath) { | ||
options.serviceMapping, | ||
process.env.DD_SERVICE_MAPPING ? fromEntries( | ||
process.env.DD_SERVICE_MAPPING.split(',').map(x => x.trim().split(':')) | ||
) : {} | ||
process.env.DD_SERVICE_MAPPING | ||
? fromEntries( | ||
process.env.DD_SERVICE_MAPPING.split(',').map(x => x.trim().split(':')) | ||
) | ||
: {} | ||
) | ||
@@ -709,3 +708,3 @@ | ||
this.options.isCiVisibility, | ||
this._defaults['isCiVisibility'] | ||
this._defaults.isCiVisibility | ||
) | ||
@@ -723,3 +722,4 @@ } | ||
const DD_CIVISIBILITY_AGENTLESS_URL = process.env.DD_CIVISIBILITY_AGENTLESS_URL | ||
const url = DD_CIVISIBILITY_AGENTLESS_URL ? new URL(DD_CIVISIBILITY_AGENTLESS_URL) | ||
const url = DD_CIVISIBILITY_AGENTLESS_URL | ||
? new URL(DD_CIVISIBILITY_AGENTLESS_URL) | ||
: getAgentUrl(this._getTraceAgentUrl(), this.options) | ||
@@ -815,3 +815,3 @@ const DD_AGENT_HOST = coalesce( | ||
this._setBoolean(calc, 'isGitUploadEnabled', | ||
calc['isIntelligentTestRunnerEnabled'] && !isFalse(this._isCiVisibilityGitUploadEnabled())) | ||
calc.isIntelligentTestRunnerEnabled && !isFalse(this._isCiVisibilityGitUploadEnabled())) | ||
this._setBoolean(calc, 'spanComputePeerService', this._getSpanComputePeerService()) | ||
@@ -818,0 +818,0 @@ this._setBoolean(calc, 'stats.enabled', this._isTraceStatsComputationEnabled()) |
@@ -25,3 +25,3 @@ // encoding used here is sha256 | ||
const currentHash = shaHash(`${service}${env}` + edgeTags.join('')) | ||
const buf = Buffer.concat([ currentHash, parentHash ], 16) | ||
const buf = Buffer.concat([currentHash, parentHash], 16) | ||
const val = shaHash(buf.toString()) | ||
@@ -28,0 +28,0 @@ cache.set(key, val) |
@@ -276,8 +276,8 @@ const os = require('os') | ||
const dataStreamsContext = { | ||
hash: hash, | ||
edgeStartNs: edgeStartNs, | ||
pathwayStartNs: pathwayStartNs, | ||
hash, | ||
edgeStartNs, | ||
pathwayStartNs, | ||
previousDirection: direction, | ||
closestOppositeDirectionHash: closestOppositeDirectionHash, | ||
closestOppositeDirectionEdgeStart: closestOppositeDirectionEdgeStart | ||
closestOppositeDirectionHash, | ||
closestOppositeDirectionEdgeStart | ||
} | ||
@@ -293,8 +293,8 @@ if (direction === 'direction:out') { | ||
currentTimestamp: nowNs, | ||
parentHash: parentHash, | ||
hash: hash, | ||
edgeTags: edgeTags, | ||
edgeLatencyNs: edgeLatencyNs, | ||
pathwayLatencyNs: pathwayLatencyNs, | ||
payloadSize: payloadSize | ||
parentHash, | ||
hash, | ||
edgeTags, | ||
edgeLatencyNs, | ||
pathwayLatencyNs, | ||
payloadSize | ||
} | ||
@@ -325,3 +325,3 @@ this.recordCheckpoint(checkpoint, span) | ||
for (const [ timeNs, bucket ] of this.buckets.entries()) { | ||
for (const [timeNs, bucket] of this.buckets.entries()) { | ||
const points = [] | ||
@@ -360,5 +360,5 @@ | ||
module.exports = { | ||
DataStreamsProcessor: DataStreamsProcessor, | ||
StatsPoint: StatsPoint, | ||
StatsBucket: StatsBucket, | ||
DataStreamsProcessor, | ||
StatsPoint, | ||
StatsBucket, | ||
Backlog, | ||
@@ -365,0 +365,0 @@ TimeBuckets, |
@@ -331,4 +331,4 @@ 'use strict' | ||
'*': { | ||
'language': 'javascript', | ||
'library_version': ddTraceVersion | ||
language: 'javascript', | ||
library_version: ddTraceVersion | ||
} | ||
@@ -335,0 +335,0 @@ }, |
@@ -111,3 +111,3 @@ 'use strict' | ||
{ | ||
filename: `coverage1.msgpack`, | ||
filename: 'coverage1.msgpack', | ||
contentType: 'application/msgpack' | ||
@@ -114,0 +114,0 @@ } |
@@ -9,2 +9,3 @@ 'use strict' | ||
const https = require('https') | ||
// eslint-disable-next-line n/no-deprecated-api | ||
const { parse: urlParse } = require('url') | ||
@@ -11,0 +12,0 @@ const zlib = require('zlib') |
@@ -1,2 +0,1 @@ | ||
const { SpanStatsEncoder } = require('../../encode/span-stats') | ||
@@ -3,0 +2,0 @@ |
@@ -54,7 +54,7 @@ const tracerLogger = require('../../log')// path to require tracer logger | ||
...log, | ||
'timestamp': Date.now(), | ||
'hostname': log.hostname || this.hostname, | ||
'ddsource': log.ddsource || this.ddsource, | ||
'service': log.service || this.service, | ||
'ddtags': logTags || undefined | ||
timestamp: Date.now(), | ||
hostname: log.hostname || this.hostname, | ||
ddsource: log.ddsource || this.ddsource, | ||
service: log.service || this.service, | ||
ddtags: logTags || undefined | ||
} | ||
@@ -61,0 +61,0 @@ |
@@ -164,5 +164,7 @@ 'use strict' | ||
} | ||
get instrumentationLibrary () { | ||
return this._parentTracer.instrumentationLibrary | ||
} | ||
get _spanProcessor () { | ||
@@ -169,0 +171,0 @@ return this._parentTracer.getActiveSpanProcessor() |
@@ -324,3 +324,3 @@ 'use strict' | ||
if (matches.length) { | ||
const [ version, traceId, spanId, flags, tail ] = matches.slice(1) | ||
const [version, traceId, spanId, flags, tail] = matches.slice(1) | ||
const traceparent = { version } | ||
@@ -327,0 +327,0 @@ const tracestate = TraceState.fromString(carrier.tracestate) |
@@ -213,3 +213,3 @@ 'use strict' | ||
} else { | ||
log.warn(`Dropping span link attribute. It is not of an allowed type`) | ||
log.warn('Dropping span link attribute. It is not of an allowed type') | ||
} | ||
@@ -216,0 +216,0 @@ } |
@@ -28,3 +28,5 @@ const TracingPlugin = require('./tracing') | ||
end (ctx) { | ||
ctx?.currentStore?.span.finish() | ||
// Only synchronous operations would have `result` or `error` on `end`. | ||
if (!ctx.hasOwnProperty('result') && !ctx.hasOwnProperty('error')) return | ||
ctx?.currentStore?.span?.finish() | ||
} | ||
@@ -31,0 +33,0 @@ |
@@ -45,3 +45,3 @@ const { | ||
if (err) { | ||
log.error(`Intelligent Test Runner configuration could not be fetched. ${err.message}`) | ||
log.error(`Library configuration could not be fetched. ${err.message}`) | ||
} else { | ||
@@ -127,2 +127,3 @@ this.libraryConfig = libraryConfig | ||
log.error(`Known tests could not be fetched. ${err.message}`) | ||
this.libraryConfig.isEarlyFlakeDetectionEnabled = false | ||
} | ||
@@ -129,0 +130,0 @@ onDone({ err, knownTests }) |
@@ -17,6 +17,5 @@ 'use strict' | ||
for (const name in this.constructor.plugins) { | ||
const pluginConfig = config[name] === false ? false : { | ||
...config, | ||
...config[name] | ||
} | ||
const pluginConfig = config[name] === false | ||
? false | ||
: { ...config, ...config[name] } | ||
@@ -23,0 +22,0 @@ this[name].configure(pluginConfig) |
@@ -23,2 +23,3 @@ 'use strict' | ||
} | ||
encodingServiceTags (serviceTag, encodeATag, spanConfig) { | ||
@@ -25,0 +26,0 @@ if (serviceTag !== spanConfig) { |
@@ -21,24 +21,24 @@ 'use strict' | ||
get '@smithy/smithy-client' () { return require('../../../datadog-plugin-aws-sdk/src') }, | ||
get 'aerospike' () { return require('../../../datadog-plugin-aerospike/src') }, | ||
get 'amqp10' () { return require('../../../datadog-plugin-amqp10/src') }, | ||
get 'amqplib' () { return require('../../../datadog-plugin-amqplib/src') }, | ||
get aerospike () { return require('../../../datadog-plugin-aerospike/src') }, | ||
get amqp10 () { return require('../../../datadog-plugin-amqp10/src') }, | ||
get amqplib () { return require('../../../datadog-plugin-amqplib/src') }, | ||
get 'aws-sdk' () { return require('../../../datadog-plugin-aws-sdk/src') }, | ||
get 'bunyan' () { return require('../../../datadog-plugin-bunyan/src') }, | ||
get bunyan () { return require('../../../datadog-plugin-bunyan/src') }, | ||
get 'cassandra-driver' () { return require('../../../datadog-plugin-cassandra-driver/src') }, | ||
get 'child_process' () { return require('../../../datadog-plugin-child_process/src') }, | ||
get 'connect' () { return require('../../../datadog-plugin-connect/src') }, | ||
get 'couchbase' () { return require('../../../datadog-plugin-couchbase/src') }, | ||
get 'cypress' () { return require('../../../datadog-plugin-cypress/src') }, | ||
get 'dns' () { return require('../../../datadog-plugin-dns/src') }, | ||
get 'elasticsearch' () { return require('../../../datadog-plugin-elasticsearch/src') }, | ||
get 'express' () { return require('../../../datadog-plugin-express/src') }, | ||
get 'fastify' () { return require('../../../datadog-plugin-fastify/src') }, | ||
get child_process () { return require('../../../datadog-plugin-child_process/src') }, | ||
get connect () { return require('../../../datadog-plugin-connect/src') }, | ||
get couchbase () { return require('../../../datadog-plugin-couchbase/src') }, | ||
get cypress () { return require('../../../datadog-plugin-cypress/src') }, | ||
get dns () { return require('../../../datadog-plugin-dns/src') }, | ||
get elasticsearch () { return require('../../../datadog-plugin-elasticsearch/src') }, | ||
get express () { return require('../../../datadog-plugin-express/src') }, | ||
get fastify () { return require('../../../datadog-plugin-fastify/src') }, | ||
get 'find-my-way' () { return require('../../../datadog-plugin-find-my-way/src') }, | ||
get 'graphql' () { return require('../../../datadog-plugin-graphql/src') }, | ||
get 'grpc' () { return require('../../../datadog-plugin-grpc/src') }, | ||
get 'hapi' () { return require('../../../datadog-plugin-hapi/src') }, | ||
get 'http' () { return require('../../../datadog-plugin-http/src') }, | ||
get 'http2' () { return require('../../../datadog-plugin-http2/src') }, | ||
get 'https' () { return require('../../../datadog-plugin-http/src') }, | ||
get 'ioredis' () { return require('../../../datadog-plugin-ioredis/src') }, | ||
get graphql () { return require('../../../datadog-plugin-graphql/src') }, | ||
get grpc () { return require('../../../datadog-plugin-grpc/src') }, | ||
get hapi () { return require('../../../datadog-plugin-hapi/src') }, | ||
get http () { return require('../../../datadog-plugin-http/src') }, | ||
get http2 () { return require('../../../datadog-plugin-http2/src') }, | ||
get https () { return require('../../../datadog-plugin-http/src') }, | ||
get ioredis () { return require('../../../datadog-plugin-ioredis/src') }, | ||
get 'jest-circus' () { return require('../../../datadog-plugin-jest/src') }, | ||
@@ -50,17 +50,17 @@ get 'jest-config' () { return require('../../../datadog-plugin-jest/src') }, | ||
get 'jest-worker' () { return require('../../../datadog-plugin-jest/src') }, | ||
get 'koa' () { return require('../../../datadog-plugin-koa/src') }, | ||
get koa () { return require('../../../datadog-plugin-koa/src') }, | ||
get 'koa-router' () { return require('../../../datadog-plugin-koa/src') }, | ||
get 'kafkajs' () { return require('../../../datadog-plugin-kafkajs/src') }, | ||
get 'mariadb' () { return require('../../../datadog-plugin-mariadb/src') }, | ||
get 'memcached' () { return require('../../../datadog-plugin-memcached/src') }, | ||
get kafkajs () { return require('../../../datadog-plugin-kafkajs/src') }, | ||
get mariadb () { return require('../../../datadog-plugin-mariadb/src') }, | ||
get memcached () { return require('../../../datadog-plugin-memcached/src') }, | ||
get 'microgateway-core' () { return require('../../../datadog-plugin-microgateway-core/src') }, | ||
get 'mocha' () { return require('../../../datadog-plugin-mocha/src') }, | ||
get mocha () { return require('../../../datadog-plugin-mocha/src') }, | ||
get 'mocha-each' () { return require('../../../datadog-plugin-mocha/src') }, | ||
get 'moleculer' () { return require('../../../datadog-plugin-moleculer/src') }, | ||
get 'mongodb' () { return require('../../../datadog-plugin-mongodb-core/src') }, | ||
get moleculer () { return require('../../../datadog-plugin-moleculer/src') }, | ||
get mongodb () { return require('../../../datadog-plugin-mongodb-core/src') }, | ||
get 'mongodb-core' () { return require('../../../datadog-plugin-mongodb-core/src') }, | ||
get 'mysql' () { return require('../../../datadog-plugin-mysql/src') }, | ||
get 'mysql2' () { return require('../../../datadog-plugin-mysql2/src') }, | ||
get 'net' () { return require('../../../datadog-plugin-net/src') }, | ||
get 'next' () { return require('../../../datadog-plugin-next/src') }, | ||
get mysql () { return require('../../../datadog-plugin-mysql/src') }, | ||
get mysql2 () { return require('../../../datadog-plugin-mysql2/src') }, | ||
get net () { return require('../../../datadog-plugin-net/src') }, | ||
get next () { return require('../../../datadog-plugin-next/src') }, | ||
get 'node:dns' () { return require('../../../datadog-plugin-dns/src') }, | ||
@@ -71,16 +71,16 @@ get 'node:http' () { return require('../../../datadog-plugin-http/src') }, | ||
get 'node:net' () { return require('../../../datadog-plugin-net/src') }, | ||
get 'oracledb' () { return require('../../../datadog-plugin-oracledb/src') }, | ||
get 'openai' () { return require('../../../datadog-plugin-openai/src') }, | ||
get 'paperplane' () { return require('../../../datadog-plugin-paperplane/src') }, | ||
get 'pg' () { return require('../../../datadog-plugin-pg/src') }, | ||
get 'pino' () { return require('../../../datadog-plugin-pino/src') }, | ||
get oracledb () { return require('../../../datadog-plugin-oracledb/src') }, | ||
get openai () { return require('../../../datadog-plugin-openai/src') }, | ||
get paperplane () { return require('../../../datadog-plugin-paperplane/src') }, | ||
get pg () { return require('../../../datadog-plugin-pg/src') }, | ||
get pino () { return require('../../../datadog-plugin-pino/src') }, | ||
get 'pino-pretty' () { return require('../../../datadog-plugin-pino/src') }, | ||
get 'playwright' () { return require('../../../datadog-plugin-playwright/src') }, | ||
get 'redis' () { return require('../../../datadog-plugin-redis/src') }, | ||
get 'restify' () { return require('../../../datadog-plugin-restify/src') }, | ||
get 'rhea' () { return require('../../../datadog-plugin-rhea/src') }, | ||
get 'router' () { return require('../../../datadog-plugin-router/src') }, | ||
get 'sharedb' () { return require('../../../datadog-plugin-sharedb/src') }, | ||
get 'tedious' () { return require('../../../datadog-plugin-tedious/src') }, | ||
get 'winston' () { return require('../../../datadog-plugin-winston/src') } | ||
get playwright () { return require('../../../datadog-plugin-playwright/src') }, | ||
get redis () { return require('../../../datadog-plugin-redis/src') }, | ||
get restify () { return require('../../../datadog-plugin-restify/src') }, | ||
get rhea () { return require('../../../datadog-plugin-rhea/src') }, | ||
get router () { return require('../../../datadog-plugin-router/src') }, | ||
get sharedb () { return require('../../../datadog-plugin-sharedb/src') }, | ||
get tedious () { return require('../../../datadog-plugin-tedious/src') }, | ||
get winston () { return require('../../../datadog-plugin-winston/src') } | ||
} |
@@ -87,3 +87,3 @@ 'use strict' | ||
if (!store.span._spanContext._tags['error']) { | ||
if (!store.span._spanContext._tags.error) { | ||
store.span.setTag('error', error || 1) | ||
@@ -90,0 +90,0 @@ } |
@@ -97,3 +97,3 @@ 'use strict' | ||
addError (error, span = this.activeSpan) { | ||
if (!span._spanContext._tags['error']) { | ||
if (!span._spanContext._tags.error) { | ||
// Errors may be wrapped in a context. | ||
@@ -100,0 +100,0 @@ error = (error && error.error) || error |
@@ -291,3 +291,4 @@ const path = require('path') | ||
const testSuitePath = testSuiteAbsolutePath === sourceRoot | ||
? testSuiteAbsolutePath : path.relative(sourceRoot, testSuiteAbsolutePath) | ||
? testSuiteAbsolutePath | ||
: path.relative(sourceRoot, testSuiteAbsolutePath) | ||
@@ -294,0 +295,0 @@ return testSuitePath.replace(path.sep, '/') |
@@ -66,3 +66,3 @@ 'use strict' | ||
span.context()._name = `${name}.request` | ||
span.context()._tags['component'] = name | ||
span.context()._tags.component = name | ||
@@ -267,3 +267,3 @@ web.setConfig(req, config) | ||
const error = context.error | ||
const hasExistingError = span.context()._tags['error'] || span.context()._tags[ERROR_MESSAGE] | ||
const hasExistingError = span.context()._tags.error || span.context()._tags[ERROR_MESSAGE] | ||
@@ -410,3 +410,3 @@ if (!hasExistingError && !context.config.validateStatus(statusCode)) { | ||
function isOriginAllowed (req, headers) { | ||
const origin = req.headers['origin'] | ||
const origin = req.headers.origin | ||
const allowOrigin = headers['access-control-allow-origin'] | ||
@@ -504,3 +504,3 @@ | ||
const protocol = getProtocol(req) | ||
return `${protocol}://${req.headers['host']}${req.originalUrl || req.url}` | ||
return `${protocol}://${req.headers.host}${req.originalUrl || req.url}` | ||
} | ||
@@ -507,0 +507,0 @@ } |
@@ -240,3 +240,3 @@ 'use strict' | ||
return [ ...new Set(strategies) ] | ||
return [...new Set(strategies)] | ||
} | ||
@@ -243,0 +243,0 @@ |
@@ -15,3 +15,3 @@ 'use strict' | ||
constructor (options = {}) { | ||
this._level = mapping[options.level] || mapping['error'] | ||
this._level = mapping[options.level] || mapping.error | ||
} | ||
@@ -18,0 +18,0 @@ |
@@ -241,8 +241,11 @@ 'use strict' | ||
*/ | ||
const captureELU = ('eventLoopUtilization' in performance) ? () => { | ||
// if elu is undefined (first run) the measurement is from start of process | ||
elu = performance.eventLoopUtilization(elu) | ||
let captureELU = () => {} | ||
if ('eventLoopUtilization' in performance) { | ||
captureELU = () => { | ||
// if elu is undefined (first run) the measurement is from start of process | ||
elu = performance.eventLoopUtilization(elu) | ||
client.gauge('runtime.node.event_loop.utilization', elu.utilization) | ||
} : () => {} | ||
client.gauge('runtime.node.event_loop.utilization', elu.utilization) | ||
} | ||
} | ||
@@ -249,0 +252,0 @@ function captureCommonMetrics () { |
@@ -7,3 +7,3 @@ 'use strict' | ||
if (process.platform !== 'win32' && process.platform !== 'linux') { | ||
log.error(`Serverless Mini Agent is only supported on Windows and Linux.`) | ||
log.error('Serverless Mini Agent is only supported on Windows and Linux.') | ||
return | ||
@@ -38,3 +38,4 @@ } | ||
const rustBinaryPathOsFolder = process.platform === 'win32' | ||
? 'datadog-serverless-agent-windows-amd64' : 'datadog-serverless-agent-linux-amd64' | ||
? 'datadog-serverless-agent-windows-amd64' | ||
: 'datadog-serverless-agent-linux-amd64' | ||
@@ -41,0 +42,0 @@ const rustBinaryExtension = process.platform === 'win32' ? '.exe' : '' |
@@ -1,2 +0,1 @@ | ||
function configWithFallback ({ tracerService, pluginConfig }) { | ||
@@ -3,0 +2,0 @@ return pluginConfig.service || tracerService |
@@ -61,7 +61,7 @@ 'use strict' | ||
if (this._killAll) { | ||
started.map(startedSpan => { | ||
for (const startedSpan of started) { | ||
if (!startedSpan._finished) { | ||
startedSpan.finish() | ||
} | ||
}) | ||
} | ||
} | ||
@@ -68,0 +68,0 @@ } |
@@ -184,3 +184,3 @@ const os = require('os') | ||
for (const [ timeNs, bucket ] of this.buckets.entries()) { | ||
for (const [timeNs, bucket] of this.buckets.entries()) { | ||
const bucketAggStats = [] | ||
@@ -187,0 +187,0 @@ |
@@ -15,3 +15,3 @@ 'use strict' | ||
const FILE_URI_START = `file://` | ||
const FILE_URI_START = 'file://' | ||
const moduleLoadStartChannel = dc.channel('dd-trace:moduleLoadStart') | ||
@@ -25,8 +25,7 @@ | ||
function createBatchPayload (payload) { | ||
const batchPayload = [] | ||
payload.map(item => { | ||
batchPayload.push({ | ||
const batchPayload = payload.map(item => { | ||
return { | ||
request_type: item.reqType, | ||
payload: item.payload | ||
}) | ||
} | ||
}) | ||
@@ -33,0 +32,0 @@ |
@@ -38,3 +38,3 @@ 'use strict' | ||
const reqType = retryObj.payload[0].request_type | ||
retryData = { payload: payload, reqType: reqType } | ||
retryData = { payload, reqType } | ||
@@ -47,13 +47,13 @@ // Since this payload failed twice it now gets save in to the extended heartbeat | ||
if (failedReqType === 'app-integrations-change') { | ||
if (extendedHeartbeatPayload['integrations']) { | ||
extendedHeartbeatPayload['integrations'].push(failedPayload) | ||
if (extendedHeartbeatPayload.integrations) { | ||
extendedHeartbeatPayload.integrations.push(failedPayload) | ||
} else { | ||
extendedHeartbeatPayload['integrations'] = [failedPayload] | ||
extendedHeartbeatPayload.integrations = [failedPayload] | ||
} | ||
} | ||
if (failedReqType === 'app-dependencies-loaded') { | ||
if (extendedHeartbeatPayload['dependencies']) { | ||
extendedHeartbeatPayload['dependencies'].push(failedPayload) | ||
if (extendedHeartbeatPayload.dependencies) { | ||
extendedHeartbeatPayload.dependencies.push(failedPayload) | ||
} else { | ||
extendedHeartbeatPayload['dependencies'] = [failedPayload] | ||
extendedHeartbeatPayload.dependencies = [failedPayload] | ||
} | ||
@@ -192,8 +192,7 @@ } | ||
function createBatchPayload (payload) { | ||
const batchPayload = [] | ||
payload.map(item => { | ||
batchPayload.push({ | ||
const batchPayload = payload.map(item => { | ||
return { | ||
request_type: item.reqType, | ||
payload: item.payload | ||
}) | ||
} | ||
}) | ||
@@ -208,6 +207,6 @@ | ||
const batchPayload = createBatchPayload([payload, retryData]) | ||
return { 'reqType': 'message-batch', 'payload': batchPayload } | ||
return { reqType: 'message-batch', payload: batchPayload } | ||
} | ||
return { 'reqType': currReqType, 'payload': currPayload } | ||
return { reqType: currReqType, payload: currPayload } | ||
} | ||
@@ -214,0 +213,0 @@ |
@@ -1,2 +0,1 @@ | ||
const request = require('../exporters/common/request') | ||
@@ -3,0 +2,0 @@ const log = require('../log') |
@@ -35,9 +35,2 @@ 'use strict' | ||
switch (c) { | ||
default: // ordinary character | ||
if (sx < subject.length && subject[sx] === c) { | ||
px++ | ||
sx++ | ||
continue | ||
} | ||
break | ||
case '?': | ||
@@ -55,2 +48,9 @@ if (sx < subject.length) { | ||
continue | ||
default: // ordinary character | ||
if (sx < subject.length && subject[sx] === c) { | ||
px++ | ||
sx++ | ||
continue | ||
} | ||
break | ||
} | ||
@@ -57,0 +57,0 @@ } |
Sorry, the diff of this file is not supported yet
1677910
36
48831
+ Added@datadog/pprof@5.2.0(transitive)
- Removed@datadog/pprof@5.1.0(transitive)
Updated@datadog/pprof@5.2.0
Updatedpprof-format@^2.1.0