Skip to content

Commit d7a574b

Browse files
tlhunterblemoine
andauthoredFeb 12, 2025
fix(config): keep the lookup value as passed (#5244)
The previous version was transforming the lookup parameter to a string. Closes #4894 Co-authored-by: Benoit Lemoine <benoit.lemoine@busbud.com>
1 parent fd1dd7e commit d7a574b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ class Config {
996996
this._setBoolean(opts, 'llmobs.agentlessEnabled', options.llmobs?.agentlessEnabled)
997997
this._setString(opts, 'llmobs.mlApp', options.llmobs?.mlApp)
998998
this._setBoolean(opts, 'logInjection', options.logInjection)
999-
this._setString(opts, 'lookup', options.lookup)
999+
this._setValue(opts, 'lookup', options.lookup)
10001000
this._setBoolean(opts, 'middlewareTracingEnabled', options.middlewareTracingEnabled)
10011001
this._setBoolean(opts, 'openAiLogsEnabled', options.openAiLogsEnabled)
10021002
this._setValue(opts, 'peerServiceMapping', options.peerServiceMapping)

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

+7
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,13 @@ describe('Config', () => {
16361636
expect(config.tags).to.include({ foo: 'bar', baz: 'qux' })
16371637
})
16381638

1639+
it('should not transform the lookup parameter', () => {
1640+
const lookup = () => 'test'
1641+
const config = new Config({ lookup: lookup })
1642+
1643+
expect(config.lookup).to.equal(lookup)
1644+
})
1645+
16391646
it('should not set DD_INSTRUMENTATION_TELEMETRY_ENABLED if AWS_LAMBDA_FUNCTION_NAME is present', () => {
16401647
process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-great-lambda-function'
16411648

0 commit comments

Comments
 (0)