Skip to content

fix(configuration): add missing config fallback defaults for file/env consistency#6717

Draft
MikeGoldsmith wants to merge 3 commits into
open-telemetry:mainfrom
honeycombio:mike/add-missing-config-fallbacks
Draft

fix(configuration): add missing config fallback defaults for file/env consistency#6717
MikeGoldsmith wants to merge 3 commits into
open-telemetry:mainfrom
honeycombio:mike/add-missing-config-fallbacks

Conversation

@MikeGoldsmith
Copy link
Copy Markdown
Member

Which problem is this PR solving?

Several spec-defined default values were missing or inconsistent between FileConfigFactory (YAML config) and EnvironmentConfigFactory (env vars), causing different behavior depending on config source.

Key issues:

  • BLRP schedule_delay defaulted to 5000ms (BSP value) instead of the spec-defined 1000ms for batch log record processors
  • log_level defaulted to 'info' in file config but was unset in env config
  • Tracer provider limits (event_count_limit, link_count_limit, etc.) were initialized in env config but not applied as defaults in file config
  • Meter provider exemplar_filter defaulted to 'trace_based' in env config but not in file config

Short description of the changes

FileConfigFactory.ts:

  • Split applyBatchProcessorDefaults into separate span (5000ms) and log (1000ms) schedule_delay defaults
  • Add tracer provider limits defaults: event_count_limit, link_count_limit, event_attribute_count_limit, link_attribute_count_limit (all 128)
  • Add logger provider attribute_count_limit default (128)
  • Add meter provider exemplar_filter default ('trace_based')

utils.ts:

  • Add log_level: 'info' to initializeDefaultConfiguration() so env-based config matches file-based config

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

82 configuration package tests pass. 189 sdk-node tests pass. Full repo compiles cleanly.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

Closes #5945

- Fix BLRP schedule_delay default: was 5000 (same as BSP) but spec
  says 1000 for batch log record processors
- Add log_level: 'info' to initializeDefaultConfiguration so env-based
  config matches file-based config default
- Add tracer provider limits defaults (event_count_limit,
  link_count_limit, event_attribute_count_limit,
  link_attribute_count_limit) in FileConfigFactory
- Add logger provider attribute_count_limit default in FileConfigFactory
- Add meter provider exemplar_filter: 'trace_based' default in
  FileConfigFactory

Closes open-telemetry#5945

Assisted-by: Claude Opus 4.6
@MikeGoldsmith MikeGoldsmith requested a review from a team as a code owner May 15, 2026 12:23
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (81e20d0) to head (69c2fb2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6717   +/-   ##
=======================================
  Coverage   94.86%   94.87%           
=======================================
  Files         376      376           
  Lines       12712    12732   +20     
  Branches     2883     2896   +13     
=======================================
+ Hits        12059    12079   +20     
  Misses        653      653           
Files with missing lines Coverage Δ
...al/packages/configuration/src/FileConfigFactory.ts 98.87% <100.00%> (+0.14%) ⬆️
experimental/packages/configuration/src/utils.ts 98.03% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Extend test-for-coverage.yaml with tracer_provider (limits),
meter_provider (periodic reader), and logger_provider (limits) to
exercise the new default-applying code paths.

Assisted-by: Claude Opus 4.6
Copy link
Copy Markdown
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to hold on these changes. See the discussion at #6679 (comment) about where defaults should be applied for declarative config handling.

tl;dr: I don't think the "parse" handling in the configuration package should be adding any defaults to the parsed config object.

I'm not going to block, though. While I hope the #6679 discussion is resolved soon enough, it has been stalled for a little while.

@MikeGoldsmith
Copy link
Copy Markdown
Member Author

Moving to draft until #6679 is resolved

@MikeGoldsmith MikeGoldsmith marked this pull request as draft May 18, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add all fallback options for config model

2 participants