Skip to content

Commit

Permalink
A bunch more messages
Browse files Browse the repository at this point in the history
  • Loading branch information
iunanua committed Nov 29, 2024
1 parent d23f868 commit 1c253ec
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dc.subscribe(CHANNEL, (payload) => {
loadChannel.publish({ name, version: payload.version, file })
payload.module = hook(payload.module, payload.version)
} catch (e) {
log.error(e)
log.error('Error executing bundler hook', e)
}
}
})
6 changes: 3 additions & 3 deletions packages/datadog-instrumentations/src/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ function cliWrapper (cli, jestVersion) {
earlyFlakeDetectionFaultyThreshold = libraryConfig.earlyFlakeDetectionFaultyThreshold
}
} catch (err) {
log.error(err)
log.error('Jest library configuration error', err)
}

if (isEarlyFlakeDetectionEnabled) {
Expand All @@ -472,7 +472,7 @@ function cliWrapper (cli, jestVersion) {
isEarlyFlakeDetectionEnabled = false
}
} catch (err) {
log.error(err)
log.error('Jest known tests error', err)
}
}

Expand All @@ -491,7 +491,7 @@ function cliWrapper (cli, jestVersion) {
skippableSuites = receivedSkippableSuites
}
} catch (err) {
log.error(err)
log.error('Jest test-suite skippable error', err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/datadog-instrumentations/src/playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ function runnerHook (runnerExport, playwrightVersion) {
}
} catch (e) {
isEarlyFlakeDetectionEnabled = false
log.error(e)
log.error('Playwright session start error', e)
}

if (isEarlyFlakeDetectionEnabled && semver.gte(playwrightVersion, MINIMUM_SUPPORTED_VERSION_EFD)) {
Expand All @@ -425,7 +425,7 @@ function runnerHook (runnerExport, playwrightVersion) {
}
} catch (err) {
isEarlyFlakeDetectionEnabled = false
log.error(err)
log.error('Playwright known tests error', err)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EventBridge extends BaseAwsSdkPlugin {
}
request.params.Entries[0].Detail = finalData
} catch (e) {
log.error(e)
log.error('EventBridge error injecting request', e)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-plugin-aws-sdk/src/services/kinesis.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Kinesis extends BaseAwsSdkPlugin {
parsedAttributes: decodedData._datadog
}
} catch (e) {
log.error(e)
log.error('Kinesis error extracting response', e)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-plugin-aws-sdk/src/services/lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Lambda extends BaseAwsSdkPlugin {
const newContextBase64 = Buffer.from(JSON.stringify(clientContext)).toString('base64')
request.params.ClientContext = newContextBase64
} catch (err) {
log.error(err)
log.error('Lambda error injecting request', err)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-plugin-aws-sdk/src/services/sqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Sqs extends BaseAwsSdkPlugin {
return JSON.parse(buffer)
}
} catch (e) {
log.error(e)
log.error('Sqs error parsing DD attributes', e)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-plugin-oracledb/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getUrl (connectString) {
try {
return new URL(`http://${connectString}`)
} catch (e) {
log.error(e)
log.error('Invalid oracle connection string', e)
return {}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/datadog-shimmer/src/shimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ function wrapMethod (target, name, wrapper, noAssert) {
if (callState.completed) {
// error was thrown after original function returned/resolved, so
// it was us. log it.
log.error(e)
log.error('Shimmer error was thrown after original function returned/resolved', e)
// original ran and returned something. return it.
return callState.retVal
}

if (!callState.called) {
// error was thrown before original function was called, so
// it was us. log it.
log.error(e)
log.error('Shimmer error was thrown before original function was called', e)
// original never ran. call it unwrapped.
return original.apply(this, args)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class TestVisDynamicInstrumentation {
}
}).unref()

this.worker.on('error', (err) => log.error(err))
this.worker.on('messageerror', (err) => log.error(err))
this.worker.on('error', (err) => log.error('ci-visibility DI worker error', err))
this.worker.on('messageerror', (err) => log.error('ci-visibility DI worker messageerror', err))
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/src/debugger/devtools_client/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = module.exports = {
updateUrl(parentConfig)

configPort.on('message', updateUrl)
configPort.on('messageerror', (err) => log.error(err))
configPort.on('messageerror', (err) => log.error('Debugger config messageerror', err))

function updateUrl (updates) {
config.url = updates.url || format({
Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/src/debugger/devtools_client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ session.on('Debugger.paused', async ({ params }) => {

// TODO: Process template (DEBUG-2628)
send(probe.template, logger, snapshot, (err) => {
if (err) log.error(err)
if (err) log.error('Debugger error', err)
else ackEmitting(probe)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rcPort.on('message', async ({ action, conf: probe, ackId }) => {
ackError(err, probe)
}
})
rcPort.on('messageerror', (err) => log.error(err))
rcPort.on('messageerror', (err) => log.error('Debugger RC message error', err))

async function start () {
sessionStarted = true
Expand Down
2 changes: 1 addition & 1 deletion packages/dd-trace/src/debugger/devtools_client/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ackEmitting ({ id: probeId, version }) {
}

function ackError (err, { id: probeId, version }) {
log.error(err)
log.error('Debugger ackError', err)

onlyUniqueUpdates(STATUSES.ERROR, probeId, version, () => {
const payload = statusPayload(probeId, version, STATUSES.ERROR)
Expand Down
8 changes: 4 additions & 4 deletions packages/dd-trace/src/debugger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function start (config, rc) {
ack(error)
rcAckCallbacks.delete(ackId)
})
rcChannel.port2.on('messageerror', (err) => log.error(err))
rcChannel.port2.on('messageerror', (err) => log.error('Debugger RC messageerror', err))

worker = new Worker(
join(__dirname, 'devtools_client', 'index.js'),
Expand All @@ -63,13 +63,13 @@ function start (config, rc) {
log.debug(`Dynamic Instrumentation worker thread started successfully (thread id: ${worker.threadId})`)
})

worker.on('error', (err) => log.error(err))
worker.on('messageerror', (err) => log.error(err))
worker.on('error', (err) => log.error('Debugger worker error', err))
worker.on('messageerror', (err) => log.error('Debugger worker messageerror', err))

worker.on('exit', (code) => {
const error = new Error(`Dynamic Instrumentation worker thread exited unexpectedly with code ${code}`)

log.error(error)
log.error('Debugger worker exited unexpectedly', error)

// Be nice, clean up now that the worker thread encounted an issue and we can't continue
rc.removeProductHandler('LIVE_DEBUGGING')
Expand Down
10 changes: 5 additions & 5 deletions packages/dd-trace/src/plugins/util/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function sanitizedExec (
exitCode: err.status || err.errno
})
}
log.error(err)
log.error('Git plugin error executing command', err)
return ''
} finally {
storage.enterWith(store)
Expand Down Expand Up @@ -144,7 +144,7 @@ function unshallowRepository () {
], { stdio: 'pipe' })
} catch (err) {
// If the local HEAD is a commit that has not been pushed to the remote, the above command will fail.
log.error(err)
log.error('Git plugin error executing git command', err)
incrementCountMetric(
TELEMETRY_GIT_COMMAND_ERRORS,
{ command: 'unshallow', errorType: err.code, exitCode: err.status || err.errno }
Expand All @@ -157,7 +157,7 @@ function unshallowRepository () {
], { stdio: 'pipe' })
} catch (err) {
// If the CI is working on a detached HEAD or branch tracking hasn’t been set up, the above command will fail.
log.error(err)
log.error('Git plugin error executing fallback git command', err)
incrementCountMetric(
TELEMETRY_GIT_COMMAND_ERRORS,
{ command: 'unshallow', errorType: err.code, exitCode: err.status || err.errno }
Expand Down Expand Up @@ -272,7 +272,7 @@ function generatePackFilesForCommits (commitsToUpload) {
try {
result = execGitPackObjects(temporaryPath)
} catch (err) {
log.error(err)
log.error('Git plugin error executing git pack-objects command', err)
incrementCountMetric(
TELEMETRY_GIT_COMMAND_ERRORS,
{ command: 'pack_objects', exitCode: err.status || err.errno, errorType: err.code }
Expand All @@ -292,7 +292,7 @@ function generatePackFilesForCommits (commitsToUpload) {
try {
result = execGitPackObjects(cwdPath)
} catch (err) {
log.error(err)
log.error('Git plugin error executing fallback git pack-objects command', err)
incrementCountMetric(
TELEMETRY_GIT_COMMAND_ERRORS,
{ command: 'pack_objects', exitCode: err.status || err.errno, errorType: err.code }
Expand Down
4 changes: 2 additions & 2 deletions packages/dd-trace/src/plugins/util/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ function getHeadersToRecord (config) {
.map(h => h.split(':'))
.map(([key, tag]) => [key.toLowerCase(), tag])
} catch (err) {
log.error(err)
log.error('Web plugin error getting headers', err)
}
} else if (config.hasOwnProperty('headers')) {
log.error('Expected `headers` to be an array of strings.')
Expand Down Expand Up @@ -595,7 +595,7 @@ function getQsObfuscator (config) {
try {
return new RegExp(obfuscator, 'gi')
} catch (err) {
log.error(err)
log.error('Web plugin error getting qs obfuscator', err)
}
}

Expand Down

0 comments on commit 1c253ec

Please sign in to comment.