Skip to content

Commit b743747

Browse files
fix(configuration): remove default propagator initialization (#6399)
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 48e2fb4 commit b743747

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

experimental/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ For notes on migrating to 2.x / 0.200.x see [the upgrade guide](doc/upgrade-to-2
2121

2222
### :bug: Bug Fixes
2323

24+
* fix(configuration): remove default propagator initialization [#6399](https://github.com/open-telemetry/opentelemetry-js/pull/6399) @MikeGoldsmith
2425
* fix(instrumentation-fetch): preserve Response.url, type, and redirected properties [#6243](https://github.com/open-telemetry/opentelemetry-js/issues/6243) @AnubhavPurohit691
2526
* The fetch instrumentation now preserves the read-only `url`, `type`, and `redirected` properties from the original Response object when wrapping it with a Proxy. This fixes issues where code relying on these properties (e.g., CORS type detection) would fail with instrumented fetch.
2627
* fix(exporter-prometheus): add missing `@opentelemetry/semantic-conventions` dependency [#6330](https://github.com/open-telemetry/opentelemetry-js/pull/6330) @omizha

experimental/packages/configuration/src/FileConfigFactory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ export function setPropagator(
287287
);
288288
if (compositeListString) {
289289
config.propagator!.composite_list = compositeListString;
290+
} else if (auxList.length > 0) {
291+
// Generate composite_list from the composite entries
292+
config.propagator!.composite_list = auxList.join(',');
290293
}
291294
}
292295
}

experimental/packages/configuration/src/models/configModel.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ export function initializeDefaultConfiguration(): ConfigurationModel {
8181
attribute_limits: {
8282
attribute_count_limit: 128,
8383
},
84-
propagator: {
85-
composite: [{ tracecontext: null }, { baggage: null }],
86-
composite_list: 'tracecontext,baggage',
87-
},
8884
};
8985

9086
return config;

experimental/packages/configuration/test/ConfigFactory.test.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ const defaultConfig: ConfigurationModel = {
5353
attribute_limits: {
5454
attribute_count_limit: 128,
5555
},
56-
propagator: {
57-
composite: [{ tracecontext: null }, { baggage: null }],
58-
composite_list: 'tracecontext,baggage',
59-
},
56+
propagator: {},
6057
};
6158

6259
const defaultTracerProvider: TracerProvider = {
@@ -1112,6 +1109,14 @@ describe('ConfigFactory', function () {
11121109
assert.deepStrictEqual(configFactory.getConfigModel(), expectedConfig);
11131110
});
11141111

1112+
it('should not set propagators by default', function () {
1113+
const configFactory = createConfigFactory();
1114+
const config = configFactory.getConfigModel();
1115+
assert.deepStrictEqual(config, defaultConfig);
1116+
assert.strictEqual(config.propagator?.composite, undefined);
1117+
assert.strictEqual(config.propagator?.composite_list, undefined);
1118+
});
1119+
11151120
it('should return config with custom propagator', function () {
11161121
process.env.OTEL_PROPAGATORS = 'tracecontext,jaeger';
11171122
const expectedConfig: ConfigurationModel = {
@@ -2102,7 +2107,11 @@ describe('ConfigFactory', function () {
21022107
'test/fixtures/short-config.yml';
21032108
const configFactory = createConfigFactory();
21042109
const expectedConfig: ConfigurationModel = {
2105-
...defaultConfig,
2110+
disabled: false,
2111+
log_level: DiagLogLevel.INFO,
2112+
attribute_limits: {
2113+
attribute_count_limit: 128,
2114+
},
21062115
resource: {
21072116
attributes_list: 'service.instance.id=123',
21082117
attributes: [
@@ -2350,7 +2359,11 @@ describe('ConfigFactory', function () {
23502359
'test/fixtures/resources.yaml';
23512360
const configFactory = createConfigFactory();
23522361
const expectedConfig: ConfigurationModel = {
2353-
...defaultConfig,
2362+
disabled: false,
2363+
log_level: DiagLogLevel.INFO,
2364+
attribute_limits: {
2365+
attribute_count_limit: 128,
2366+
},
23542367
resource: {
23552368
schema_url: 'https://opentelemetry.io/schemas/1.16.0',
23562369
attributes_list:
@@ -2470,7 +2483,10 @@ describe('ConfigFactory', function () {
24702483
config = {};
24712484
setPropagator(config, { composite: [{ tracecontext: null }] });
24722485
assert.deepStrictEqual(config, {
2473-
propagator: { composite: [{ tracecontext: null }] },
2486+
propagator: {
2487+
composite: [{ tracecontext: null }],
2488+
composite_list: 'tracecontext',
2489+
},
24742490
});
24752491

24762492
const res = getTemporalityPreference(

0 commit comments

Comments
 (0)