Skip to content

Commit 75b36d3

Browse files
blemoinetlhunter
authored andcommitted
fix(config): keep the lookup value as passed
The previous version was transforming the lookup parameter to a string. Closes #4894
1 parent b8c03bd commit 75b36d3

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
@@ -992,7 +992,7 @@ class Config {
992992
this._setBoolean(opts, 'llmobs.agentlessEnabled', options.llmobs?.agentlessEnabled)
993993
this._setString(opts, 'llmobs.mlApp', options.llmobs?.mlApp)
994994
this._setBoolean(opts, 'logInjection', options.logInjection)
995-
this._setString(opts, 'lookup', options.lookup)
995+
this._setValue(opts, 'lookup', options.lookup)
996996
this._setBoolean(opts, 'middlewareTracingEnabled', options.middlewareTracingEnabled)
997997
this._setBoolean(opts, 'openAiLogsEnabled', options.openAiLogsEnabled)
998998
this._setValue(opts, 'peerServiceMapping', options.peerServiceMapping)

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

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

1617+
it('should not transform the lookup parameter', () => {
1618+
const lookup = () => 'test'
1619+
const config = new Config({ lookup: lookup })
1620+
1621+
expect(config.lookup).to.equal(lookup)
1622+
})
1623+
16171624
it('should not set DD_INSTRUMENTATION_TELEMETRY_ENABLED if AWS_LAMBDA_FUNCTION_NAME is present', () => {
16181625
process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-great-lambda-function'
16191626

0 commit comments

Comments
 (0)