Skip to content

Commit 030413c

Browse files
authored
refactor(config): drop low-use internalPropertyName aliases (#8211)
The `internalPropertyName` field in `supported-configurations.json` renames the runtime config property to a camelCase alias (e.g. `config.ciVisAgentlessLogSubmissionEnabled`). For 28 entries where the alias was used fewer than eight times in the codebase, the alias earns its keep less than it costs to maintain a parallel name. Drops the field and switches the call sites to read `config.<DD_*>` / `config.<OTEL_*>` directly, matching what the loader already does for every entry without an alias. Telemetry origin, defaults, and value parsing are unchanged — the field only controlled the property path on the in-memory config object. `generated-config-types.d.ts` is regenerated to match.
1 parent 538b574 commit 030413c

23 files changed

Lines changed: 127 additions & 155 deletions

File tree

packages/datadog-instrumentations/src/jest.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let knownTests = {}
7878
let isCodeCoverageEnabled = false
7979
let isCodeCoverageEnabledBecauseOfUs = false
8080
let isSuitesSkippingEnabled = false
81-
let isKeepingCoverageConfiguration = false
81+
let DD_TEST_TIA_KEEP_COV_CONFIG = false
8282
let isUserCodeCoverageEnabled = false
8383
let isSuitesSkipped = false
8484
let numSkippedSuites = 0
@@ -1141,8 +1141,8 @@ function getCliWrapper (isNewJestVersion) {
11411141
if (!err) {
11421142
isCodeCoverageEnabled = libraryConfig.isCodeCoverageEnabled
11431143
isSuitesSkippingEnabled = libraryConfig.isSuitesSkippingEnabled
1144-
isKeepingCoverageConfiguration =
1145-
libraryConfig.isKeepingCoverageConfiguration ?? isKeepingCoverageConfiguration
1144+
DD_TEST_TIA_KEEP_COV_CONFIG =
1145+
libraryConfig.DD_TEST_TIA_KEEP_COV_CONFIG ?? DD_TEST_TIA_KEEP_COV_CONFIG
11461146
isEarlyFlakeDetectionEnabled = libraryConfig.isEarlyFlakeDetectionEnabled
11471147
earlyFlakeDetectionNumRetries = libraryConfig.earlyFlakeDetectionNumRetries
11481148
earlyFlakeDetectionSlowTestRetries = libraryConfig.earlyFlakeDetectionSlowTestRetries ?? {}
@@ -1495,7 +1495,7 @@ function coverageReporterWrapper (coverageReporter) {
14951495
*/
14961496
// `_addUntestedFiles` is an async function
14971497
shimmer.wrap(CoverageReporter.prototype, '_addUntestedFiles', addUntestedFiles => function () {
1498-
if (isKeepingCoverageConfiguration) {
1498+
if (DD_TEST_TIA_KEEP_COV_CONFIG) {
14991499
return addUntestedFiles.apply(this, arguments)
15001500
}
15011501
if (isCodeCoverageEnabledBecauseOfUs) {
@@ -1697,7 +1697,7 @@ function configureTestEnvironment (readConfigsResult) {
16971697
...readConfigsResult.globalConfig,
16981698
passWithNoTests: true,
16991699
}
1700-
if (isCodeCoverageEnabledBecauseOfUs && !isKeepingCoverageConfiguration) {
1700+
if (isCodeCoverageEnabledBecauseOfUs && !DD_TEST_TIA_KEEP_COV_CONFIG) {
17011701
globalConfig.coverageReporters = ['none']
17021702
readConfigsResult.configs = configs.map(config => ({
17031703
...config,

packages/datadog-plugin-dd-trace-api/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = class DdTraceApiPlugin extends Plugin {
1414
super(...args)
1515

1616
const tracer = this._tracer
17-
const injectionEnabledTag = `injection_enabled:${this._tracerConfig.injectionEnabled ? 'yes' : 'no'}`
17+
const injectionEnabledTag = `injection_enabled:${this._tracerConfig.DD_INJECTION_ENABLED ? 'yes' : 'no'}`
1818

1919
this.addSub('datadog-api:v1:tracerinit', ({ proxy }) => {
2020
const proxyVal = proxy()

packages/datadog-plugin-graphql/src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ function extractErrorIntoSpanEvent (config, span, exc) {
2626
attributes.message = exc.message
2727
}
2828

29-
if (config.graphqlErrorExtensions) {
30-
for (const ext of config.graphqlErrorExtensions) {
29+
if (config.DD_TRACE_GRAPHQL_ERROR_EXTENSIONS) {
30+
for (const ext of config.DD_TRACE_GRAPHQL_ERROR_EXTENSIONS) {
3131
if (exc.extensions?.[ext]) {
3232
const value = exc.extensions[ext]
3333

packages/datadog-plugin-memcached/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MemcachedPlugin extends CachePlugin {
1616
[CLIENT_PORT_KEY]: address[1],
1717
}
1818

19-
if (this.config.memcachedCommandEnabled) {
19+
if (this.config.DD_TRACE_MEMCACHED_COMMAND_ENABLED) {
2020
meta['memcached.command'] = query.command
2121
}
2222

packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class CiVisibilityExporter extends BufferingExporter {
234234
testManagementAttemptToFixRetries ?? this._config.testManagementAttemptToFixRetries,
235235
isImpactedTestsEnabled: isImpactedTestsEnabled && this._config.isImpactedTestsEnabled,
236236
isCoverageReportUploadEnabled,
237-
isKeepingCoverageConfiguration: this._config.isKeepingCoverageConfiguration,
237+
DD_TEST_TIA_KEEP_COV_CONFIG: this._config.DD_TEST_TIA_KEEP_COV_CONFIG,
238238
}
239239
}
240240

packages/dd-trace/src/config/generated-config-types.d.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ export interface GeneratedConfig {
4848
baggageMaxBytes: number;
4949
baggageMaxItems: number;
5050
baggageTagKeys: string[];
51-
ciVisAgentlessLogSubmissionEnabled: boolean;
52-
ciVisibilityTestSessionName: string | undefined;
5351
clientIpEnabled: boolean;
5452
clientIpHeader: string | undefined;
5553
cloudPayloadTagging: {
@@ -73,6 +71,7 @@ export interface GeneratedConfig {
7371
};
7472
dbmPropagationMode: string;
7573
DD_ACTION_EXECUTION_ID: string | undefined;
74+
DD_AGENTLESS_LOG_SUBMISSION_ENABLED: boolean;
7675
DD_AGENTLESS_LOG_SUBMISSION_URL: string | undefined;
7776
DD_APM_FLUSH_DEADLINE_MILLISECONDS: number;
7877
DD_AZURE_RESOURCE_GROUP: string | undefined;
@@ -83,6 +82,7 @@ export interface GeneratedConfig {
8382
DD_CIVISIBILITY_DANGEROUSLY_FORCE_TEST_SKIPPING: boolean;
8483
DD_CIVISIBILITY_ENABLED: boolean;
8584
DD_CIVISIBILITY_GIT_UNSHALLOW_ENABLED: boolean;
85+
DD_CIVISIBILITY_MANUAL_API_ENABLED: boolean;
8686
DD_CIVISIBILITY_RUM_FLUSH_WAIT_MILLIS: number;
8787
DD_CIVISIBILITY_TEST_COMMAND: string | undefined;
8888
DD_CIVISIBILITY_TEST_MODULE_ID: string | undefined;
@@ -111,8 +111,12 @@ export interface GeneratedConfig {
111111
DD_GIT_PULL_REQUEST_BASE_BRANCH_SHA: string | undefined;
112112
DD_GIT_REPOSITORY_URL: string | undefined;
113113
DD_GIT_TAG: string | undefined;
114+
DD_INJECT_FORCE: boolean;
115+
DD_INJECTION_ENABLED: string | undefined;
116+
DD_INSTRUMENTATION_CONFIG_ID: string | undefined;
114117
DD_INTERNAL_PROFILING_TIMELINE_SAMPLING_ENABLED: boolean;
115118
DD_LAMBDA_HANDLER: string | undefined;
119+
DD_LOGS_OTEL_ENABLED: boolean;
116120
DD_MINI_AGENT_PATH: string | undefined;
117121
DD_PIPELINE_EXECUTION_ID: string | undefined;
118122
DD_PLAYWRIGHT_WORKER: string | undefined;
@@ -147,6 +151,8 @@ export interface GeneratedConfig {
147151
DD_TELEMETRY_FORWARDER_PATH: string | undefined;
148152
DD_TEST_FLEET_CONFIG_PATH: string | undefined;
149153
DD_TEST_LOCAL_CONFIG_PATH: string | undefined;
154+
DD_TEST_SESSION_NAME: string | undefined;
155+
DD_TEST_TIA_KEEP_COV_CONFIG: boolean;
150156
DD_TRACE_AEROSPIKE_ENABLED: boolean;
151157
DD_TRACE_AI_ENABLED: boolean;
152158
DD_TRACE_AMQP10_ENABLED: boolean;
@@ -239,11 +245,13 @@ export interface GeneratedConfig {
239245
DD_TRACE_FS_ENABLED: boolean;
240246
DD_TRACE_GCP_PUBSUB_PUSH_ENABLED: boolean;
241247
DD_TRACE_GENERIC_POOL_ENABLED: boolean;
248+
DD_TRACE_GIT_METADATA_ENABLED: boolean;
242249
DD_TRACE_GOOGLE_CLOUD_PUBSUB_ENABLED: boolean;
243250
DD_TRACE_GOOGLE_CLOUD_VERTEXAI_ENABLED: boolean;
244251
DD_TRACE_GOOGLE_GAX_ENABLED: boolean;
245252
DD_TRACE_GOOGLE_GENAI_ENABLED: boolean;
246253
DD_TRACE_GRAPHQL_ENABLED: boolean;
254+
DD_TRACE_GRAPHQL_ERROR_EXTENSIONS: string[];
247255
DD_TRACE_GRAPHQL_TAG_ENABLED: boolean;
248256
DD_TRACE_GRAPHQL_TOOLS_ENABLED: boolean;
249257
DD_TRACE_GRAPHQL_TOOLS_EXECUTOR_ENABLED: boolean;
@@ -292,6 +300,7 @@ export interface GeneratedConfig {
292300
DD_TRACE_LODASH_ENABLED: boolean;
293301
DD_TRACE_LOOPBACK_ENABLED: boolean;
294302
DD_TRACE_MARIADB_ENABLED: boolean;
303+
DD_TRACE_MEMCACHED_COMMAND_ENABLED: boolean;
295304
DD_TRACE_MEMCACHED_ENABLED: boolean;
296305
DD_TRACE_MICROGATEWAY_CORE_ENABLED: boolean;
297306
DD_TRACE_MIDDIE_ENABLED: boolean;
@@ -335,6 +344,7 @@ export interface GeneratedConfig {
335344
DD_TRACE_PROCESS_ENABLED: boolean;
336345
DD_TRACE_PROMISE_ENABLED: boolean;
337346
DD_TRACE_PROMISE_JS_ENABLED: boolean;
347+
DD_TRACE_PROPAGATION_EXTRACT_FIRST: boolean;
338348
DD_TRACE_PROPAGATION_STYLE: string[];
339349
DD_TRACE_PROTOBUFJS_ENABLED: boolean;
340350
DD_TRACE_PUG_ENABLED: boolean;
@@ -352,6 +362,7 @@ export interface GeneratedConfig {
352362
DD_TRACE_SEQUELIZE_ENABLED: boolean;
353363
DD_TRACE_SHAREDB_ENABLED: boolean;
354364
DD_TRACE_SMITHY_SMITHY_CLIENT_ENABLED: boolean;
365+
DD_TRACE_SPAN_LEAK_DEBUG: number;
355366
DD_TRACE_SQLITE3_ENABLED: boolean;
356367
DD_TRACE_SUFFIXPLUGIN_ENABLED: boolean;
357368
DD_TRACE_TAGS: Record<string, string> | undefined;
@@ -365,6 +376,7 @@ export interface GeneratedConfig {
365376
DD_TRACE_WINSTON_ENABLED: boolean;
366377
DD_TRACE_WORKERPOOL_ENABLED: boolean;
367378
DD_TRACE_WS_ENABLED: boolean;
379+
DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH: number;
368380
DD_VITEST_WORKER: string | undefined;
369381
dogstatsd: {
370382
hostname: string;
@@ -405,8 +417,6 @@ export interface GeneratedConfig {
405417
flakyTestRetriesCount: number;
406418
flushInterval: number;
407419
flushMinSpans: number;
408-
gitMetadataEnabled: boolean;
409-
graphqlErrorExtensions: string[];
410420
grpc: {
411421
client: {
412422
error: {
@@ -443,21 +453,16 @@ export interface GeneratedConfig {
443453
telemetryVerbosity: string;
444454
};
445455
inferredProxyServicesEnabled: boolean;
446-
injectForce: boolean;
447-
injectionEnabled: string | undefined;
448456
installSignature: {
449457
id: string | undefined;
450458
time: string | undefined;
451459
type: string | undefined;
452460
};
453-
instrumentation_config_id: string | undefined;
454461
isEarlyFlakeDetectionEnabled: boolean;
455462
isFlakyTestRetriesEnabled: boolean;
456463
isGitUploadEnabled: boolean;
457464
isImpactedTestsEnabled: boolean;
458465
isIntelligentTestRunnerEnabled: boolean;
459-
isKeepingCoverageConfiguration: boolean;
460-
isManualApiEnabled: boolean;
461466
isTestDynamicInstrumentationEnabled: boolean;
462467
isTestManagementEnabled: boolean;
463468
langchain: {
@@ -472,43 +477,41 @@ export interface GeneratedConfig {
472477
};
473478
logInjection: boolean;
474479
logLevel: "debug" | "info" | "warn" | "error";
475-
memcachedCommandEnabled: boolean;
476480
middlewareTracingEnabled: boolean;
477481
openai: {
478482
spanCharLimit: number;
479483
};
480484
openAiLogsEnabled: boolean;
485+
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: number;
486+
OTEL_BSP_MAX_QUEUE_SIZE: number;
487+
OTEL_BSP_SCHEDULE_DELAY: number;
481488
OTEL_EXPORTER_OTLP_ENDPOINT: string | undefined;
482489
OTEL_EXPORTER_OTLP_HEADERS: Record<string, string> | undefined;
490+
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: string;
483491
OTEL_EXPORTER_OTLP_LOGS_HEADERS: Record<string, string> | undefined;
492+
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: string;
493+
OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: number;
494+
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: string;
484495
OTEL_EXPORTER_OTLP_METRICS_HEADERS: Record<string, string> | undefined;
496+
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: string;
497+
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "DELTA" | "CUMULATIVE" | "LOWMEMORY";
498+
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: number;
499+
OTEL_EXPORTER_OTLP_PROTOCOL: string;
500+
OTEL_EXPORTER_OTLP_TIMEOUT: number;
485501
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: string;
486502
OTEL_EXPORTER_OTLP_TRACES_HEADERS: Record<string, string> | undefined;
487503
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: "http/json";
488504
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: number;
489505
OTEL_LOGS_EXPORTER: "none" | "otlp" | undefined;
506+
OTEL_METRIC_EXPORT_INTERVAL: number;
507+
OTEL_METRIC_EXPORT_TIMEOUT: number;
490508
OTEL_METRICS_EXPORTER: "none" | "otlp" | undefined;
491509
OTEL_RESOURCE_ATTRIBUTES: Record<string, string>;
492510
OTEL_SDK_DISABLED: boolean;
493511
OTEL_TRACES_EXPORTER: "none" | "otlp" | undefined;
494512
OTEL_TRACES_SAMPLER: "always_on" | "always_off" | "traceidratio" | "parentbased_always_on" | "parentbased_always_off" | "parentbased_traceidratio";
495513
OTEL_TRACES_SAMPLER_ARG: number | undefined;
496-
otelBatchTimeout: number;
497-
otelLogsEnabled: boolean;
498-
otelLogsProtocol: string;
499-
otelLogsTimeout: number;
500-
otelLogsUrl: string;
501-
otelMaxExportBatchSize: number;
502-
otelMaxQueueSize: number;
503514
otelMetricsEnabled: boolean;
504-
otelMetricsExportInterval: number;
505-
otelMetricsExportTimeout: number;
506-
otelMetricsProtocol: string;
507-
otelMetricsTemporalityPreference: "DELTA" | "CUMULATIVE" | "LOWMEMORY";
508-
otelMetricsTimeout: number;
509-
otelMetricsUrl: string;
510-
otelProtocol: string;
511-
otelTimeout: number;
512515
peerServiceMapping: Record<string, string>;
513516
port: string | number;
514517
profiling: {
@@ -542,15 +545,13 @@ export interface GeneratedConfig {
542545
site: string;
543546
spanAttributeSchema: "v0" | "v1";
544547
spanComputePeerService: boolean;
545-
spanLeakDebug: number;
546548
spanRemoveIntegrationFromService: boolean;
547549
spanSamplingRules: import('../../../../index').SpanSamplingRule[] | undefined;
548550
startupLogs: boolean;
549551
stats: {
550552
enabled: boolean;
551553
};
552554
tags: Record<string, string>;
553-
tagsHeaderMaxLength: number;
554555
telemetry: {
555556
debug: boolean;
556557
dependencyCollection: boolean;
@@ -573,7 +574,6 @@ export interface GeneratedConfig {
573574
traceId128BitGenerationEnabled: boolean;
574575
traceId128BitLoggingEnabled: boolean;
575576
tracePropagationBehaviorExtract: "continue" | "restart" | "ignore";
576-
tracePropagationExtractFirst: boolean;
577577
tracePropagationStyle: {
578578
extract: string[];
579579
inject: string[];

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class Config extends ConfigBase {
214214

215215
warnWrongOtelSettings()
216216

217-
if (this.gitMetadataEnabled) {
217+
if (this.DD_TRACE_GIT_METADATA_ENABLED) {
218218
this.#loadGitMetadata()
219219
}
220220

@@ -355,7 +355,7 @@ class Config extends ConfigBase {
355355
}
356356
// Disable log injection when OTEL logs are enabled
357357
// OTEL logs and DD log injection are mutually exclusive
358-
if (this.otelLogsEnabled) {
358+
if (this.DD_LOGS_OTEL_ENABLED) {
359359
setAndTrack(this, 'logInjection', false)
360360
}
361361
if (this.otelMetricsEnabled &&
@@ -427,7 +427,7 @@ class Config extends ConfigBase {
427427
))
428428
}
429429

430-
if (this.injectionEnabled) {
430+
if (this.DD_INJECTION_ENABLED) {
431431
setAndTrack(this, 'instrumentationSource', 'ssi')
432432
}
433433

@@ -600,11 +600,11 @@ class Config extends ConfigBase {
600600
// Default OTLP endpoints follow the configured agent host so users who point DD at a custom
601601
// agent (DD_AGENT_HOST / DD_TRACE_AGENT_URL) also reach OTLP on that host.
602602
const defaultOtlpBase = this.OTEL_EXPORTER_OTLP_ENDPOINT?.replace(/\/$/, '') ?? `http://${agentHostname}:4318`
603-
if (!this.otelLogsUrl) {
604-
setAndTrack(this, 'otelLogsUrl', `${defaultOtlpBase}/v1/logs`)
603+
if (!this.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT) {
604+
setAndTrack(this, 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT', `${defaultOtlpBase}/v1/logs`)
605605
}
606-
if (!this.otelMetricsUrl) {
607-
setAndTrack(this, 'otelMetricsUrl', `${defaultOtlpBase}/v1/metrics`)
606+
if (!this.OTEL_EXPORTER_OTLP_METRICS_ENDPOINT) {
607+
setAndTrack(this, 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', `${defaultOtlpBase}/v1/metrics`)
608608
}
609609
if (!this.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) {
610610
setAndTrack(this, 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT', `${defaultOtlpBase}/v1/traces`)

0 commit comments

Comments
 (0)