Skip to content

Commit

Permalink
more correct package guardrails (#4600)
Browse files Browse the repository at this point in the history
While _functioning_ correctly, the logging and telemetry was broken for
packages that met one range, but didn't meet a subsequent range. This is
now fixed.
  • Loading branch information
bengl authored Aug 13, 2024
1 parent 683df27 commit e970623
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion integration-tests/package-guardrails.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ false
})
context('when fastify is latest and logging enabled', () => {
useSandbox(['fastify'])
it('should instrument the package', () => runTest('true\n'))
useEnv({ DD_TRACE_DEBUG })
it('should instrument the package', () =>
runTest('Application instrumentation bootstrapping complete\ntrue\n'))
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-instrumentations/src/helpers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ for (const packageName of names) {
log.error(e)
continue
}
if (!Object.hasOwnProperty(namesAndSuccesses, name)) {
if (typeof namesAndSuccesses[`${name}@${version}`] === 'undefined') {
namesAndSuccesses[`${name}@${version}`] = false
}

Expand Down

0 comments on commit e970623

Please sign in to comment.