fix: apply spec-defined BLRP schedule_delay default in sdk-node, default log_level in env config#6788
Conversation
…og_level in env config Two small fixes split out from open-telemetry#6717: 1. BatchLogRecordProcessor: apply spec-defined schedule_delay default of 1000ms when building from declarative config. The SDK's BatchLogRecordProcessorBase defaults to 5000ms (same as BSP), but the OTel config spec says BLRP schedule_delay defaults to 1000ms. Apply the correct default at the consumer boundary in sdk-node. 2. initializeDefaultConfiguration: default log_level to 'info' so the env-based config has the same default as file-based config (where the spec-defined default of INFO is applied in the same place). Assisted-by: Claude Opus 4.6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6788 +/- ##
=======================================
Coverage 94.92% 94.92%
=======================================
Files 377 377
Lines 12832 12832
Branches 2928 2928
=======================================
Hits 12181 12181
Misses 651 651
🚀 New features to boost your workflow:
|
I think we should consider it a bug in sdk-logs that it defaults So if we update the default value in sdk-logs, then we no longer need a separate application of a default value in the configuration handling in sdk-node. Update: I've opened #6796 for this. |
Which problem is this PR solving?
Two small fixes for spec-conformance gaps, split out from #6717 (now closed) per Trent's preferred direction in #6765: defaults should be applied at the consumer boundary (sdk-node), not in the parse step of the
configurationpackage.1. BatchLogRecordProcessor schedule_delay
The OTel config spec defines
schedule_delayforBatchLogRecordProcessoras 1000ms. The JS SDK'sBatchLogRecordProcessorBasedefaults it to 5000ms (same as BSP), which is an SDK-level divergence from spec. Apply the correct 1000ms default at the consumer boundary ingetLogRecordProcessorsFromConfiguration.2. log_level default for env config
FileConfigFactory.parseConfigFile()produces a model withlog_level: 'info'when the field is absent from the YAML.EnvironmentConfigFactorydid not have a matching default, so env-based configs produced models withoutlog_levelset unlessOTEL_LOG_LEVELwas provided. Adding the default ininitializeDefaultConfiguration()makes env and file config consistent.Type of change
How Has This Been Tested?