Skip to content

Commit

Permalink
fix(config): keep the lookup value as passed
Browse files Browse the repository at this point in the history
The previous version was transforming the lookup
parameter to a string.

Closes DataDog#4894
  • Loading branch information
blemoine committed Nov 18, 2024
1 parent 61c5a32 commit da0f19a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dd-trace/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ class Config {
this._setBoolean(opts, 'llmobs.agentlessEnabled', options.llmobs?.agentlessEnabled)
this._setString(opts, 'llmobs.mlApp', options.llmobs?.mlApp)
this._setBoolean(opts, 'logInjection', options.logInjection)
this._setString(opts, 'lookup', options.lookup)
this._setValue(opts, 'lookup', options.lookup)
this._setBoolean(opts, 'openAiLogsEnabled', options.openAiLogsEnabled)
this._setValue(opts, 'peerServiceMapping', options.peerServiceMapping)
this._setBoolean(opts, 'plugins', options.plugins)
Expand Down
7 changes: 7 additions & 0 deletions packages/dd-trace/test/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,13 @@ describe('Config', () => {
expect(config.tags).to.include({ foo: 'bar', baz: 'qux' })
})

it('should not transform the lookup parameter', () => {
const lookup = () => 'test'
const config = new Config({ lookup: lookup })

expect(config.lookup).to.equal(lookup)
})

it('should not set DD_INSTRUMENTATION_TELEMETRY_ENABLED if AWS_LAMBDA_FUNCTION_NAME is present', () => {
process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-great-lambda-function'

Expand Down

0 comments on commit da0f19a

Please sign in to comment.