Skip to content

Internal - Factor proxy config to individual components - #662

Merged
cleverchuk merged 3 commits into
mainfrom
cc/NH-153808
Nov 3, 2026
Merged

cleverchuk merged 3 commits into
mainfrom
cc/NH-153808

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

This pull request introduces several significant changes to the configuration handling and related components in the SolarWinds OpenTelemetry extensions. The main focus is on simplifying and improving the declarative configuration loading process, enhancing test coverage, and refactoring proxy and reporter handling. Notably, it removes the ReporterProvider class, updates how configuration is loaded and merged, and refactors proxy configuration parsing to use a shared helper. Additionally, the tests for declarative configuration have been updated to reflect these changes.

Configuration Loading and Management:

  • Refactored DeclarativeLoader to directly extract and merge configuration from the distribution and solarwinds nodes, removing the SolarwindsConfigResolver and improving robustness when no configuration is present. The configuration is now initialized via ConfigManager.initialize, and error handling has been simplified. [1] [2]
  • Updated test cases in DeclarativeLoaderTest to match the new configuration logic. Tests now check for logging level configuration instead of service key/collector, ensure the loader does not throw on empty models, and verify that configuration merges with previously set values. [1] [2] [3]

Proxy Configuration Refactoring:

  • Replaced inline proxy parsing logic in HttpSamplerComponentProvider and ProfilingSpanProcessorComponentProvider with the shared ProxyHelper.toProxyConfig method, ensuring consistent and reusable proxy configuration handling. [1] [2] [3] [4] [5] [6] [7] [8]

Reporter and Shutdown Handling:

  • Removed the ReporterProvider class and its usage, simplifying shutdown logic by only closing client managers and eliminating redundant event reporter handling. [1] [2]

Dependency and Import Updates:

  • Added libs:logging as a test dependency in the Gradle build file.
  • Cleaned up imports to remove unused classes and ensure consistency with the new configuration approach. [1] [2]

These changes collectively modernize and streamline configuration management, improve code clarity, and enhance test reliability.

Test services data

  1. e-1712644058766987264
  2. e-1712643928659124224
  3. e-1742334541200846848
  4. e-1777406072376840192

…ration setting over auto-injected.

Only accept logging config from distribution node
Copilot AI balanced review requested due to automatic review settings November 2, 2026 18:11
@cleverchuk
cleverchuk requested review from a team as code owners November 2, 2026 18:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The starting configuration exports no telemetry after exporter injection was removed, while full reloads retain deleted settings and declarative profiling loses authenticated-proxy support.

3 open issues
What changed in this PR

This PR moves proxy and connection settings into individual SolarWinds OpenTelemetry components and simplifies shared declarative configuration.

Changes:

  • Introduces shared proxy parsing and standardizes declarative exporters on swo_otlp.
  • Limits distribution-level configuration to logging, adds configuration merging, and removes implicit exporter setup.
  • Updates unit tests, YAML fixtures, and proxy smoke tests while simplifying shutdown handling.
File Description
smoke-tests/​src/​test/​java/​com/​solarwinds/​SmokeTestV2.java Adds proxy assertions and container cleanup.
smoke-tests/​src/​test/​java/​com/​solarwinds/​SmokeTest.java Updates container cleanup.
smoke-tests/​sdk-config.yaml Configures component proxies and explicit HTTP exporters.
sdk-config.yaml Migrates the distribution logging key.
libs/​shared/​src/​test/​resources/​sdk-config.yaml Updates exporter naming and logging configuration.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​DelegatingMetricExporterTest.java Tests metric filtering and configuration precedence.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​SolarwindsConfigResolverTest.java Removes tests for the deleted resolver.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​ProxyHelperTest.java Adds structured proxy parsing tests.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​SpanExporterComponentProviderTest.java Tests exporter naming and proxy setup.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​SharedConfigCustomizerProviderTest.java Removes tests for implicit exporter configuration.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​MetricExporterComponentProviderTest.java Tests proxy setup and metric-export options.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​LogExporterComponentProviderTest.java Tests exporter naming and proxy setup.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​ExporterConfigs.java Adds a shared exporter configuration test helper.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​ProxyParserTest.java Removes legacy proxy parser tests.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​LogSettingParserTest.java Tests the new logging configuration location.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​DeclarativeConfigParserTest.java Tests logging-only distribution configuration.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​DelegatingMetricExporter.java Adds a per-instance metric-export default.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​SolarwindsConfigResolver.java Removes cross-node configuration resolution.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​ProxyHelper.java Adds reusable structured proxy parsing.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​SpanExporterComponentProvider.java Uses component-local proxy settings and swo_otlp.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​SharedConfigCustomizerProvider.java Removes implicit exporter and shared connection setup.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​MetricExporterComponentProvider.java Adds local proxy and metric-export configuration.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​LogExporterComponentProvider.java Uses component-local proxy settings and swo_otlp.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​ProxyParser.java Removes legacy declarative proxy parsing.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​LogSettingParser.java Renames the logging key.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​DeclarativeConfigParser.java Restricts supported distribution keys to logging.
libs/​logging/​src/​main/​java/​com/​solarwinds/​joboe/​logging/​LoggerConfiguration.java Adds whitespace only.
libs/​config/​src/​test/​java/​com/​solarwinds/​joboe/​config/​ConfigManagerTest.java Adds initialization and merge tests.
libs/​config/​src/​main/​java/​com/​solarwinds/​joboe/​config/​ConfigManager.java Merges subsequent initialization values.
libs/​config/​src/​main/​java/​com/​solarwinds/​joboe/​config/​ConfigContainer.java Adds container merging.
custom/​src/​test/​resources/​sdk-config.yaml Updates profiler credentials, exporter naming, and logging.
custom/​src/​test/​resources/​sdk-config-bad.yaml Adds credentials to the invalid-profiler fixture.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​ProfilingSpanProcessorComponentProviderTest.java Tests profiler connection settings and validation.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​HttpSamplerComponentProviderTest.java Removes strict proxy-rejection cases.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​DeclarativeLoaderTest.java Tests distribution logging, empty models, and merging.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​SolarwindsAgentListener.java Removes reporter-specific shutdown handling.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​ReporterProvider.java Removes the reporter factory wrapper.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​ProfilingSpanProcessorComponentProvider.java Reads profiler-local credentials, collector, and proxy.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​HttpSamplerComponentProvider.java Delegates proxy parsing to the shared helper.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​DeclarativeLoader.java Loads distribution logging directly into configuration management.
custom/​build.gradle.kts Adds the logging module as a test dependency.

Review effort: Balanced

Comment thread sdk-config.yaml Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The smoke-test assertion can pass when the sampler bypasses the proxy because profiler traffic sets the same flag, leaving sampler-proxy regressions undetected.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Smoke test can pass without sampler traffic using the proxy

smoke-tests/​src/​test/​java/​com/​solarwinds/​SmokeTestV2.java:187

This assertion can pass even when the sampler bypasses the proxy. smoke-tests/sdk-config.yaml also enables swo_profiler with the same collector and Squid proxy, so a profiling connection alone sets this flag. Isolate sampler traffic using a separate proxy instance/port, or check it in a run with profiling disabled, so the smoke test actually detects a sampler-proxy regression.

3 resolved since last review

Review effort: Balanced

@jerrytfleung jerrytfleung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@cleverchuk
cleverchuk merged commit 3f224f5 into main Nov 3, 2026
18 checks passed
@cleverchuk
cleverchuk deleted the cc/NH-153808 branch November 3, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants