Repository navigation
[CONFIGURATION] SDK default component builder libraries and example #4367
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
dbarker
merged 27 commits into
open-telemetry:main
from
dbarker:config_create_sdk_signal_builders
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
9846e83
add sdk logs component builders
dbarker f3328f3
add sdk metrics component builders
dbarker 7977068
add sdk trace component builders
dbarker 98345ed
update registry test
dbarker 3c1ba5a
use sdk default builders in SdkBuilder
dbarker d077f5f
add registry factory
dbarker 88bba8e
Update CMake and Bazel build files for sdk/configuration
dbarker a3442f3
update sdk configuration tests
dbarker d4c7101
update install tests to cover the new targets and headers
dbarker 460eb32
update configuration yaml example and test it
dbarker 10c5d51
fix clang-tidy and iwyu warnings
dbarker df70b99
clean up composite sampler yaml
dbarker bc9d335
add changelog entry
dbarker bf9fba3
Merge branch 'main' into config_create_sdk_signal_builders
dbarker 6c4425a
[DO NOT REVIEW - this commit is to take the yaml file and example cha…
dbarker 69b55ec
update the configuration example to use the registry factory
dbarker f34d649
Merge branch 'main' into config_create_sdk_signal_builders
dbarker 3d02037
update sdk-default.yaml to highlight the registry methods used to rep…
dbarker 5257fb1
Merge branch 'main' into config_create_sdk_signal_builders
dbarker 53e9861
Merge branch 'main' into config_create_sdk_signal_builders
dbarker 08d6f1f
fix hidden merge conflict on bazel file. clean up config example cmak…
dbarker a4ed885
Merge branch 'main' into config_create_sdk_signal_builders
dbarker 1ded9c9
Create composite sampler builder interface. Create the default compos…
dbarker e217676
Merge branch 'main' into config_create_sdk_signal_builders
dbarker 3b05f9d
cleanup the composite/composable sampler model by creating a composit…
dbarker 8c26d52
Merge branch 'main' into config_create_sdk_signal_builders
dbarker ebe7b08
fix iwyu warning after merge
dbarker 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # Copyright The OpenTelemetry Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Exercises the built-in SDK component builders. | ||
| # | ||
| # The Registry provides one builder per SDK component type. Each builder constructs its component from the parsed configuration model. | ||
| # RegistryFactory::Create() pre-loads all the SDK default builders shown in this file. | ||
| # Call Set*Builder() on the Registry to swap in your own implementation before calling ConfiguredSdk::Create: | ||
| # | ||
| # auto registry = RegistryFactory::Create(); | ||
| # registry->SetBatchSpanProcessorBuilder(std::make_unique<MyBatchSpanProcessorBuilder>()); | ||
| # auto sdk = ConfiguredSdk::Create(registry, model); | ||
|
|
||
| file_format: "1.1" | ||
| disabled: false | ||
|
|
||
| # --- Logs --- | ||
| logger_provider: | ||
| processors: | ||
| - batch: # Registry::SetBatchLogRecordProcessorBuilder | ||
| exporter: | ||
| console: # Registry::SetConsoleLogRecordBuilder | ||
| - simple: # Registry::SetSimpleLogRecordProcessorBuilder | ||
| exporter: | ||
| console: # Registry::SetConsoleLogRecordBuilder | ||
| logger_configurator/development: # Registry::SetLoggerConfiguratorBuilder | ||
| default_config: | ||
| enabled: true | ||
|
|
||
| # --- Metrics --- | ||
| meter_provider: | ||
| readers: | ||
| - periodic: # Registry::SetPeriodicMetricReaderBuilder | ||
| exporter: | ||
| console: # Registry::SetConsolePushMetricExporterBuilder | ||
| meter_configurator/development: # Registry::SetMeterConfiguratorBuilder | ||
| default_config: | ||
| enabled: true | ||
|
|
||
| # --- Propagators --- | ||
| propagator: | ||
| composite: | ||
| - tracecontext: # Registry::SetTextMapPropagatorBuilder("tracecontext") | ||
| - baggage: # Registry::SetTextMapPropagatorBuilder("baggage") | ||
| - b3: # Registry::SetTextMapPropagatorBuilder("b3") | ||
| - b3multi: # Registry::SetTextMapPropagatorBuilder("b3multi") | ||
| - jaeger: # Registry::SetTextMapPropagatorBuilder("jaeger") | ||
|
|
||
| # --- Traces --- | ||
| tracer_provider: | ||
| processors: | ||
| - batch: # Registry::SetBatchSpanProcessorBuilder | ||
| exporter: | ||
| console: # Registry::SetConsoleSpanBuilder | ||
| - simple: # Registry::SetSimpleSpanProcessorBuilder | ||
| exporter: | ||
| console: # Registry::SetConsoleSpanBuilder | ||
| sampler: # See kitchen-sink.yaml for sampler field semantics. | ||
| parent_based: # Registry::SetParentBasedSamplerBuilder | ||
| root: | ||
| composite/development: | ||
| rule_based: # Registry::SetComposableRuleBasedSamplerBuilder | ||
| rules: | ||
| - span_kinds: | ||
| - internal | ||
| sampler: | ||
| always_on: # Registry::SetComposableAlwaysOnSamplerBuilder | ||
| - attribute_patterns: | ||
| key: http.url | ||
| included: | ||
| - .*/health* | ||
| excluded: | ||
| - .*/healthz/live | ||
| sampler: | ||
| always_off: # Registry::SetComposableAlwaysOffSamplerBuilder | ||
| - attribute_values: | ||
| key: http.response.status_code | ||
| values: | ||
| - "500" | ||
| - "503" | ||
| sampler: | ||
| always_on: # Registry::SetComposableAlwaysOnSamplerBuilder | ||
| - span_kinds: | ||
| - server | ||
| - consumer | ||
| parent: | ||
| - none | ||
| sampler: | ||
| parent_threshold: # Registry::SetComposableParentThresholdSamplerBuilder | ||
| root: | ||
| probability: # Registry::SetComposableProbabilitySamplerBuilder | ||
| ratio: 0.25 | ||
| - sampler: | ||
| probability: # Registry::SetComposableProbabilitySamplerBuilder | ||
| ratio: 0.01 | ||
| remote_parent_sampled: | ||
| always_on: # Registry::SetAlwaysOnSamplerBuilder | ||
| remote_parent_not_sampled: | ||
| trace_id_ratio_based: # Registry::SetTraceIdRatioBasedSamplerBuilder | ||
| ratio: 0.001 | ||
| local_parent_sampled: | ||
| always_off: # Registry::SetAlwaysOffSamplerBuilder | ||
| local_parent_not_sampled: | ||
| probability/development: # Registry::SetProbabilitySamplerBuilder | ||
| ratio: 0.001 | ||
|
|
||
| tracer_configurator/development: # Registry::SetTracerConfiguratorBuilder | ||
| default_config: | ||
| enabled: false | ||
|
|
||
| resource: | ||
| attributes: | ||
| - name: service.name | ||
| value: sdk-builtin-test | ||
| detection/development: | ||
| detectors: | ||
| - container: # Registry::SetContainerResourceDetectorBuilder | ||
| - host: # Registry::SetHostResourceDetectorBuilder | ||
| - process: # Registry::SetProcessResourceDetectorBuilder | ||
| - service: # Registry::SetServiceResourceDetectorBuilder |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DLL build is not supported or tested for OTLP or Configuration classes (most are missing the required exports). Removing this to make the example easier to understand by moving the important config targets to the top of the file.