Skip to content

Commit 46ef22d

Browse files
Fix DD_CIVISIBILITY_AGENTLESS_ENABLED configuration (#7743)
1 parent 662ff4c commit 46ef22d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/dd-trace/src/config/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@ function getAgentUrl (url, options) {
16611661
!options.port &&
16621662
!getEnv('DD_AGENT_HOST') &&
16631663
!getEnv('DD_TRACE_AGENT_PORT') &&
1664+
!isTrue(getEnv('DD_CIVISIBILITY_AGENTLESS_ENABLED')) &&
16641665
fs.existsSync('/var/run/datadog/apm.socket')
16651666
) {
16661667
return new URL('unix:///var/run/datadog/apm.socket')

packages/dd-trace/test/config/index.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,6 +2580,14 @@ describe('Config', () => {
25802580

25812581
assert.strictEqual(config.url, '')
25822582
})
2583+
2584+
it('should not be used when DD_CIVISIBILITY_AGENTLESS_ENABLED provided', () => {
2585+
process.env.DD_CIVISIBILITY_AGENTLESS_ENABLED = 'true'
2586+
2587+
const config = getConfig()
2588+
2589+
assert.strictEqual(config.url, '')
2590+
})
25832591
})
25842592
})
25852593

0 commit comments

Comments
 (0)