-
Notifications
You must be signed in to change notification settings - Fork 629
[CONFIGURATION] Apply general attribute_limits to tracer and logger providers #4468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marcalff
merged 16 commits into
open-telemetry:main
from
ayush-singh-0601:config-general-attribute-limits
Aug 28, 2026
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c82730a
[CONFIGURATION] Apply general attribute_limits to tracer and logger p…
ayush-singh-0601 65d8341
[CONFIGURATION] Fix clang-format alignment in attribute_limits tests
ayush-singh-0601 70d4dcc
Merge branch 'main' into config-general-attribute-limits
dbarker 66cf236
[CONFIGURATION] Add defaulted attribute_limits arg to Create*Provider
ayush-singh-0601 a1556d4
Merge branch 'main' into config-general-attribute-limits
dbarker a336cf9
[CONFIGURATION] Resolve attribute limits per field
ayush-singh-0601 e3e5c5d
Merge branch 'main' into config-general-attribute-limits
dbarker c995d4e
[CONFIGURATION] Fix attribute limits CI failures
ayush-singh-0601 9643298
[CONFIGURATION] Address optional value review feedback
ayush-singh-0601 a19c5b5
Merge branch 'main' into config-general-attribute-limits
ayush-singh-0601 26ab4dc
Merge branch 'main' into config-general-attribute-limits
dbarker 3007b2c
Merge branch 'main' into config-general-attribute-limits
marcalff daea8f3
Support env substitution for optional log limits
ayush-singh-0601 a1d0321
[CONFIGURATION] Fix YAML log test IWYU includes
ayush-singh-0601 3980f8c
Merge branch 'main' into config-general-attribute-limits
marcalff 15118ce
[CONFIGURATION] Use cstdlib in yaml_logs_test for clang-tidy
ayush-singh-0601 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
55 changes: 55 additions & 0 deletions
55
sdk/include/opentelemetry/sdk/configuration/optional_value.h
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <stdexcept> | ||
|
|
||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| /** | ||
| * C++14-friendly optional for configuration fields that may be set, omitted, or | ||
| * explicitly null in YAML. | ||
| */ | ||
| template <typename T> | ||
| class OptionalValue | ||
| { | ||
| public: | ||
| OptionalValue() = default; | ||
|
|
||
| explicit OptionalValue(T value) : has_value_(true), value_(value) {} | ||
|
|
||
| bool HasValue() const { return has_value_; } | ||
|
|
||
| const T &Value() const | ||
| { | ||
| if (!has_value_) | ||
| { | ||
| throw std::runtime_error("OptionalValue has no value"); | ||
| } | ||
| return value_; | ||
| } | ||
|
|
||
| T ValueOr(T fallback) const { return has_value_ ? value_ : fallback; } | ||
|
|
||
| OptionalValue &operator=(T value) | ||
| { | ||
| has_value_ = true; | ||
| value_ = value; | ||
| return *this; | ||
| } | ||
|
|
||
| private: | ||
| bool has_value_{false}; | ||
| T value_{}; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.