Repository navigation
Internal - Split context propagator into TraceState and TraceOptions - #644
Merged
Merged
Conversation
…propagators SolarwindsContextPropagator is replaced by TraceStatePropagator (tracestate) and TraceOptionsPropagator (X-Trace-Options and signature). The autoconfigure provider keeps the "solarwinds" name and returns a composite of both. Declarative config gets one component provider per propagator (swo_tracestate, swo_xtraceoptions). The customizer no longer injects propagators, so they must be listed explicitly in sdk-config.yaml.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The trace-options propagator omits its injected headers from fields(), preventing consumers from reliably clearing reused carriers.
1 open issue
What changed in this PR
Splits SolarWinds context propagation into separate trace-state and trace-options components within the shared OpenTelemetry extensions.
Changes:
- Separates propagators and registers dedicated component providers.
- Updates YAML configurations to explicitly compose both components.
- Reorganizes tests and removes automatic propagator configuration.
| File | Description |
|---|---|
| smoke-tests/sdk-config.yaml | Configures explicit propagator composition. |
| sdk-config.yaml | Adds default propagator composition. |
| libs/shared/src/test/resources/sdk-config.yaml | Uses the new component names. |
| libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/TraceStatePropagatorTest.java | Isolates trace-state tests. |
| libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/TraceOptionsPropagatorTest.java | Focuses tests on trace options. |
| libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/config/provider/TraceStateComponentProviderTest.java | Tests trace-state provider registration. |
| libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/config/provider/TraceOptionsComponentProviderTest.java | Tests trace-options provider registration. |
| libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/config/provider/SharedConfigCustomizerProviderTest.java | Removes automatic propagator configuration assertions. |
| libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/TraceStatePropagator.java | Separates trace-state handling. |
| libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/TraceOptionsPropagator.java | Separates trace-options handling. |
| libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsContextPropagatorProvider.java | Returns both propagators as a composite. |
| libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/TraceStateComponentProvider.java | Registers swo_tracestate. |
| libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/TraceOptionsComponentProvider.java | Registers swo_xtraceoptions. |
| libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/SharedConfigCustomizerProvider.java | Removes automatic propagator insertion. |
| custom/src/test/resources/sdk-config.yaml | Uses the new component names. |
Review effort: Balanced
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.

This pull request refactors and modularizes the context propagation logic for SolarWinds OpenTelemetry extensions. It splits the previous monolithic
SolarwindsContextPropagatorinto two focused propagators: one for handling W3C trace state (TraceStatePropagator) and one for SolarWinds-specific trace options (TraceOptionsPropagator). It also updates configuration and provider classes to support this separation, and introduces new tests and component providers for each propagator.Context Propagation Refactoring:
Split the previous
SolarwindsContextPropagatorinto two separate propagators:TraceStatePropagator(handles W3C trace state) andTraceOptionsPropagator(handles SolarWindsX-Trace-Optionsheaders), each with its own implementation and responsibilities. (libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/TraceStatePropagator.java,libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/TraceOptionsPropagator.java) [1] [2]Updated the
SolarwindsContextPropagatorProviderto return a composite propagator combiningTraceStatePropagatorandTraceOptionsPropagatorinstead of the previous monolithic implementation. (libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsContextPropagatorProvider.java)Configuration and Component Provider Updates:
Added new component providers:
TraceStateComponentProviderandTraceOptionsComponentProvider, each registering their respective propagator under a new component name. (libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/TraceStateComponentProvider.java,libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/TraceOptionsComponentProvider.java) [1] [2]Updated the YAML configuration (
sdk-config.yaml) to use the new propagator component names (swo_tracestate,swo_xtraceoptions) and to explicitly list them in the composite propagator list. (custom/src/test/resources/sdk-config.yaml)Test and Code Cleanup:
Renamed and refactored tests to match the new propagator classes, removing tests no longer relevant to the split responsibilities. (
libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/TraceOptionsPropagatorTest.java) [1] [2]Cleaned up configuration customizer logic to remove now-unnecessary context propagator handling. (
libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/SharedConfigCustomizerProvider.java) [1] [2]Test services data