[CONFIGURATION] Apply general attribute_limits to tracer and logger providers - #4468
Open
ayush-singh-0601 wants to merge 1 commit into
Open
Conversation
…roviders The YAML parser already accepted attribute_limits, but SdkBuilder ignored them. Pass the general limits into CreateTracerProvider and CreateLoggerProvider, and use them when the provider has no model-specific limits. Provider limits still take precedence. Fixes open-telemetry#4467
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4468 +/- ##
==========================================
+ Coverage 82.62% 82.64% +0.02%
==========================================
Files 512 512
Lines 20139 20160 +21
==========================================
+ Hits 16638 16659 +21
Misses 3501 3501
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4467
The YAML parser already accepted
attribute_limits, butSdkBuilderlogged a warning and ignored them. Per the spec, general attribute limits should apply when tracer/loggerlimitsare not set, and model-specific limits should win when they are.Changes
attribute_limitsfromCreateConfiguredSdkintoCreateTracerProviderandCreateLoggerProvider.limits, copyattribute_count_limitandattribute_value_length_limitfrom the general config intoSpanLimits/LogRecordLimits.limits, keep using those values (including span-only fields such as event/link limits).CreateTracerProvider/CreateLoggerProvideroverloads are unchanged; a three-argument overload takes the general limits so the previous ABI is preserved.CreateConfiguredSdkwiring for both traces and logs.How changes were tested
SdkBuilder.SpanLimitsFromAttributeLimitsandSdkBuilder.SpanLimitsOverrideAttributeLimits.GetSpanLimits()on the configured tracer provider.I could not run the C++ test binaries in this environment (no local CMake/Bazel build of opentelemetry-cpp). CI should run
sdk_builder_testandprogrammatic_configuration_test.CHANGELOG.mdupdated for non-trivial changes