Skip to content

Commit

Permalink
Add missing config tests for new config options
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Jan 8, 2025
1 parent 32b1c34 commit 3936cee
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/dd-trace/test/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ describe('Config', () => {
expect(config).to.have.property('logLevel', 'debug')
expect(config).to.have.nested.property('codeOriginForSpans.enabled', false)
expect(config).to.have.property('dynamicInstrumentationEnabled', false)
expect(config).to.have.deep.property('dynamicInstrumentationRedactedIdentifiers', [])
expect(config).to.have.deep.property('dynamicInstrumentationRedactionExcludedIdentifiers', [])
expect(config).to.have.property('traceId128BitGenerationEnabled', true)
expect(config).to.have.property('traceId128BitLoggingEnabled', false)
expect(config).to.have.property('spanAttributeSchema', 'v0')
Expand Down Expand Up @@ -314,6 +316,8 @@ describe('Config', () => {
{ name: 'dogstatsd.port', value: '8125', origin: 'default' },
{ name: 'dsmEnabled', value: false, origin: 'default' },
{ name: 'dynamicInstrumentationEnabled', value: false, origin: 'default' },
{ name: 'dynamicInstrumentationRedactedIdentifiers', value: [], origin: 'default' },
{ name: 'dynamicInstrumentationRedactionExcludedIdentifiers', value: [], origin: 'default' },
{ name: 'env', value: undefined, origin: 'default' },
{ name: 'experimental.enableGetRumData', value: false, origin: 'default' },
{ name: 'experimental.exporter', value: undefined, origin: 'default' },
Expand Down Expand Up @@ -457,6 +461,8 @@ describe('Config', () => {
process.env.DD_TRACE_REPORT_HOSTNAME = 'true'
process.env.DD_ENV = 'test'
process.env.DD_DYNAMIC_INSTRUMENTATION_ENABLED = 'true'
process.env.DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS = 'foo,bar'
process.env.DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS = 'a,b,c'
process.env.DD_TRACE_GLOBAL_TAGS = 'foo:bar,baz:qux'
process.env.DD_TRACE_SAMPLE_RATE = '0.5'
process.env.DD_TRACE_RATE_LIMIT = '-1'
Expand Down Expand Up @@ -552,6 +558,8 @@ describe('Config', () => {
expect(config).to.have.property('reportHostname', true)
expect(config).to.have.nested.property('codeOriginForSpans.enabled', true)
expect(config).to.have.property('dynamicInstrumentationEnabled', true)
expect(config).to.have.deep.property('dynamicInstrumentationRedactedIdentifiers', ['foo', 'bar'])
expect(config).to.have.deep.property('dynamicInstrumentationRedactionExcludedIdentifiers', ['a', 'b', 'c'])
expect(config).to.have.property('env', 'test')
expect(config).to.have.property('sampleRate', 0.5)
expect(config).to.have.property('traceEnabled', true)
Expand Down Expand Up @@ -656,6 +664,8 @@ describe('Config', () => {
{ name: 'dogstatsd.hostname', value: 'dsd-agent', origin: 'env_var' },
{ name: 'dogstatsd.port', value: '5218', origin: 'env_var' },
{ name: 'dynamicInstrumentationEnabled', value: true, origin: 'env_var' },
{ name: 'dynamicInstrumentationRedactedIdentifiers', value: ['foo', 'bar'], origin: 'env_var' },
{ name: 'dynamicInstrumentationRedactionExcludedIdentifiers', value: ['a', 'b', 'c'], origin: 'env_var' },
{ name: 'env', value: 'test', origin: 'env_var' },
{ name: 'experimental.enableGetRumData', value: true, origin: 'env_var' },
{ name: 'experimental.exporter', value: 'log', origin: 'env_var' },
Expand Down Expand Up @@ -851,6 +861,8 @@ describe('Config', () => {
experimental: {
b3: true,
dynamicInstrumentationEnabled: true,
dynamicInstrumentationRedactedIdentifiers: ['foo', 'bar'],
dynamicInstrumentationRedactionExcludedIdentifiers: ['a', 'b', 'c'],
traceparent: true,
runtimeId: true,
exporter: 'log',
Expand Down Expand Up @@ -896,6 +908,8 @@ describe('Config', () => {
expect(config).to.have.property('service', 'service')
expect(config).to.have.property('version', '0.1.0')
expect(config).to.have.property('dynamicInstrumentationEnabled', true)
expect(config).to.have.deep.property('dynamicInstrumentationRedactedIdentifiers', ['foo', 'bar'])
expect(config).to.have.deep.property('dynamicInstrumentationRedactionExcludedIdentifiers', ['a', 'b', 'c'])
expect(config).to.have.property('env', 'test')
expect(config).to.have.property('sampleRate', 0.5)
expect(config).to.have.property('logger', logger)
Expand Down Expand Up @@ -974,6 +988,8 @@ describe('Config', () => {
{ name: 'dogstatsd.hostname', value: 'agent-dsd', origin: 'code' },
{ name: 'dogstatsd.port', value: '5218', origin: 'code' },
{ name: 'dynamicInstrumentationEnabled', value: true, origin: 'code' },
{ name: 'dynamicInstrumentationRedactedIdentifiers', value: ['foo', 'bar'], origin: 'code' },
{ name: 'dynamicInstrumentationRedactionExcludedIdentifiers', value: ['a', 'b', 'c'], origin: 'code' },
{ name: 'env', value: 'test', origin: 'code' },
{ name: 'experimental.enableGetRumData', value: true, origin: 'code' },
{ name: 'experimental.exporter', value: 'log', origin: 'code' },
Expand Down Expand Up @@ -1175,6 +1191,8 @@ describe('Config', () => {
process.env.DD_TRACE_REPORT_HOSTNAME = 'true'
process.env.DD_ENV = 'test'
process.env.DD_DYNAMIC_INSTRUMENTATION_ENABLED = 'true'
process.env.DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS = 'foo,bar'
process.env.DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS = 'a,b,c'
process.env.DD_API_KEY = '123'
process.env.DD_TRACE_SPAN_ATTRIBUTE_SCHEMA = 'v0'
process.env.DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED = 'false'
Expand Down Expand Up @@ -1253,6 +1271,8 @@ describe('Config', () => {
experimental: {
b3: false,
dynamicInstrumentationEnabled: false,
dynamicInstrumentationRedactedIdentifiers: ['foo2', 'bar2'],
dynamicInstrumentationRedactionExcludedIdentifiers: ['a2', 'b2'],
traceparent: false,
runtimeId: false,
exporter: 'agent',
Expand Down Expand Up @@ -1318,6 +1338,8 @@ describe('Config', () => {
expect(config).to.have.property('version', '1.0.0')
expect(config).to.have.nested.property('codeOriginForSpans.enabled', false)
expect(config).to.have.property('dynamicInstrumentationEnabled', false)
expect(config).to.have.deep.property('dynamicInstrumentationRedactedIdentifiers', ['foo2', 'bar2'])
expect(config).to.have.deep.property('dynamicInstrumentationRedactionExcludedIdentifiers', ['a2', 'b2'])
expect(config).to.have.property('env', 'development')
expect(config).to.have.property('clientIpEnabled', true)
expect(config).to.have.property('clientIpHeader', 'x-true-client-ip')
Expand Down

0 comments on commit 3936cee

Please sign in to comment.