Skip to content

[CONFIGURATION] Set schema default values for all parameters (#4432) - #4440

Merged
marcalff merged 3 commits into
open-telemetry:mainfrom
shashankxrm:fix/config-schema-defaults-4432
Aug 17, 2026
Merged

marcalff merged 3 commits into
open-telemetry:mainfrom
shashankxrm:fix/config-schema-defaults-4432

Conversation

@shashankxrm

Copy link
Copy Markdown
Contributor

Fixes #4432

Changes

Align declarative configuration kDefault* constants with OpenTelemetry Configuration Schema v1.1.0 when the corresponding configuration fields are omitted.

Default updates

Parameter Previous default New default (schema)
attribute_limits.attribute_value_length_limit 4096 no limit
logger_provider.limits.attribute_value_length_limit 4096 no limit
tracer_provider.limits.attribute_value_length_limit 4096 no limit
batch log processor schedule_delay 5000 ms 1000 ms
periodic metric reader interval 5000 ms 60000 ms
trace_id_ratio_based sampler ratio 0.0 1.0

The three attribute value length limits use (std::numeric_limits<std::size_t>::max)(), matching the existing SDK "no limit" representation in span_limits.h and log_record_limits.h.

Breaking behavior

When the corresponding configuration field is omitted, parsed configuration now reflects the schema defaults above instead of the previous legacy values. This affects attribute truncation, batch log export timing, metric export interval, and trace sampling ratio.

Explicit configuration values are unchanged.

The breaking changes are documented under [Unreleased] in CHANGELOG.md.

Why no parser/builder changes

configuration_parser.cc already assigns omitted fields from the corresponding Config::kDefault* constants. Updating these constants is therefore sufficient for the parsed configuration model to use the new defaults.

Tests

Local build with -DWITH_CONFIGURATION=ON and -DOTELCPP_MAINTAINER_MODE=ON:

Test Result
yaml_test 51 passed
yaml_trace_test 48 passed
yaml_logs_test 23 passed
yaml_metrics_test 47 passed
sdk_builder_test 34 passed

Default-expectation assertions in the YAML configuration tests were updated to reference the kDefault* constants. Explicit-value tests (e.g. 1111, 5555, 3.14) were not changed.

Formatting / lint

  • clang-format 18.1.8: --Werror -n passed on all 10 modified C++ files.
  • markdownlint-cli 0.46.0: CHANGELOG.md passed.

The full Docker do_ci.sh format workflow was not run locally because the Docker environment ran out of memory during third-party dependency builds. Targeted formatting validation with clang-format 18 completed successfully on all changed C++ files.

Out of scope / follow-ups

  • YAML explicit null: The parser does not currently treat explicit YAML null the same as an omitted field. This is not addressed by [CONFIGURATION] Set schema default values for all parameters #4432 and may be handled separately.
  • Root attribute_limits: The configuration is parsed but not applied by SdkBuilder; this is tracked separately in SDK Implement collection limits #3303.
  • kitchen-sink.yaml: Retains explicit legacy values such as 4096 and 5000 and is intentionally unchanged because those are explicit example configuration values.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@shashankxrm
shashankxrm requested a review from a team as a code owner August 16, 2026 13:49
@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: shashankxrm / name: Shashank RM (923406b)

@codecov

codecov Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.62%. Comparing base (717d1fb) to head (66301f2).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4440   +/-   ##
=======================================
  Coverage   82.62%   82.62%           
=======================================
  Files         511      511           
  Lines       20132    20132           
=======================================
  Hits        16633    16633           
  Misses       3499     3499           
Files with missing lines Coverage Δ
...uration/batch_log_record_processor_configuration.h 100.00% <ø> (ø)
...nfiguration/periodic_metric_reader_configuration.h 100.00% <ø> (ø)
...ation/trace_id_ratio_based_sampler_configuration.h 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

shashankxrm and others added 2 commits August 17, 2026 19:42
Avoid ODR-use of static constexpr configuration defaults in C++14 YAML tests by comparing parsed values against default-constructed configuration models.

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Thanks!

@marcalff marcalff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@marcalff
marcalff merged commit 57253cd into open-telemetry:main Aug 17, 2026
122 of 125 checks passed
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.

[CONFIGURATION] Set schema default values for all parameters

3 participants