Repository navigation
Fix - Have the Solarwinds sampler start settings polling - #687
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Validation with the actual OTel agent is still needed because mocked tests do not verify polling safety during tracer-provider customization or SDK disablement before initialization when configuration loading fails.
No open issues 🎉
What changed in this PR
Moves settings-fetcher startup into SolarwindsSampler, so settings polling depends on the sampler being constructed rather than agent startup.
Changes:
- Pass HTTP or Lambda file-based fetchers into the sampler and remove listener-owned initialization.
- Disable the SDK when agent configuration fails to load and recognize both declarative configuration property names.
- Update tests for sampler initialization, disabled-agent behavior, and configuration detection.
| File | Description |
|---|---|
spotbugs-exclude.xml |
Extend the static-field-write exclusion to the Lambda configuration provider. |
libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/SolarwindsSamplerTest.java |
Verify construction initializes settings with the supplied fetcher. |
libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsSampler.java |
Require a fetcher and sampling configuration; initialize settings on construction. |
libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/AbstractSamplerComponentProvider.java |
Pass declarative settings directly to the sampler constructor. |
libs/lambda/src/test/java/com/solarwinds/opentelemetry/extensions/TraceProviderCustomizerTest.java |
Verify sampler attachment initializes settings. |
libs/lambda/src/test/java/com/solarwinds/opentelemetry/extensions/LambdaAgentListenerTest.java |
Remove expectations for listener-owned initialization and shutdown. |
libs/lambda/src/test/java/com/solarwinds/opentelemetry/extensions/DefaultAutoConfigurationCustomizerProviderTest.java |
Test SDK disabling after configuration-load failure. |
libs/lambda/src/main/java/com/solarwinds/opentelemetry/extensions/TraceProviderCustomizer.java |
Supply the Lambda file-based settings fetcher. |
libs/lambda/src/main/java/com/solarwinds/opentelemetry/extensions/LambdaAgentListener.java |
Remove settings initialization and post-startup SDK shutdown. |
libs/lambda/src/main/java/com/solarwinds/opentelemetry/extensions/DefaultAutoConfigurationCustomizerProvider.java |
Load configuration during customization and disable the SDK on failure. |
custom/src/test/java/com/solarwinds/opentelemetry/extensions/SolarwindsTracerProviderCustomizerTest.java |
Test settings initialization and disabled-agent behavior using an injected fetcher. |
custom/src/test/java/com/solarwinds/opentelemetry/extensions/SolarwindsAgentListenerTest.java |
Remove the obsolete listener shutdown test. |
custom/src/test/java/com/solarwinds/opentelemetry/extensions/provider/AutoConfigurationCustomizerProviderImplTest.java |
Verify configuration failure disables the SDK and skips customization. |
custom/src/test/java/com/solarwinds/opentelemetry/extensions/config/ConfigurationLoaderTest.java |
Test legacy-loader bypass for both declarative configuration keys. |
custom/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsTracerProviderCustomizer.java |
Supply an HTTP fetcher through an injectable factory. |
custom/src/main/java/com/solarwinds/opentelemetry/extensions/SolarwindsAgentListener.java |
Remove fallback polling startup while retaining settings-latch waiting. |
custom/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/AutoConfigurationCustomizerProviderImpl.java |
Set otel.sdk.disabled when configuration loading fails. |
custom/src/main/java/com/solarwinds/opentelemetry/extensions/config/ConfigurationLoader.java |
Recognize otel.config.file alongside the experimental property. |
Review effort: Balanced
Settings were fetched by the agent listeners regardless of the configured sampler, so a non-Solarwinds sampler (e.g. via declarative config) still triggered getSettings polling. The sampler now owns its settings fetcher: SolarwindsSampler initializes SettingsManager on construction, and the listeners no longer start a fetcher. When the agent config fails to load, disable the SDK via otel.sdk.disabled instead of shutting it down after startup, and recognize otel.config.file for declarative config.
cleverchuk
force-pushed
the
cc/NH-153775
branch
from
November 20, 2026 19:17
0314e9c to
4363d62
Compare
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.
TL;DR
The agent polled the settings endpoint (getSettings) every 60s even when the Solarwinds sampler was not in use, e.g. when a declarative config file selected a different sampler. Settings polling is now owned by
SolarwindsSampler: the fetcher is started when the sampler is constructed, so no Solarwinds sampler means no polling. This PR also disables the SDK up front when the agent config fails to load, and recognizesotel.config.fileas enabling declarative config.Why
Changes
SolarwindsSamplernow has a single constructor taking aSettingsFetcherandSamplingConfiguration, which initializesSettingsManager. The no-arg constructor is removed, so a sampler cannot exist without a settings source.otel.sdk.disabled=trueand skip customization, instead of letting the SDK start and shutting it down in the listener afterwards. The Lambda provider now loads its config incustomize()rather than in a static initializer.otel.config.fileorotel.experimental.config.fileis set (previously only the experimental key).Testing
SettingsManager, and settings are served from the supplied fetcher.otel.sdk.disabledand registers no customizations.