Skip to content

Refactor profiler component - #643

Merged
cleverchuk merged 2 commits into
mainfrom
cc/NH-151107
Oct 15, 2026
Merged

cleverchuk merged 2 commits into
mainfrom
cc/NH-151107

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

This pull request refactors the profiling configuration handling in the OpenTelemetry SolarWinds extension. It removes the custom YAML parser for profiling settings, consolidates the logic into the ProfilingSpanProcessorComponentProvider, and updates the configuration and tests to match this new approach. The changes streamline configuration processing, improve maintainability, and ensure that profiling processor configuration is handled consistently via the component provider.

Key changes include:

Profiling Configuration Refactor:

  • Removed the ProfilingSettingsParser and its associated test, moving all profiling configuration parsing logic into ProfilingSpanProcessorComponentProvider. This centralizes and simplifies how profiling settings are applied. [1] [2] [3] [4] [5]

  • Changed the profiling processor component name from swo/profilingSpanProcessor to swo_profiler throughout the codebase and test resources for consistency. [1] [2] [3] [4]

Configuration Customization Logic:

  • Removed logic from CustomConfigCustomizerProvider that conditionally added the profiling processor based on JDK version, delegating all processor creation and configuration to the component provider. [1] [2] [3] [4] [5]

Test Updates:

  • Added comprehensive tests for ProfilingSpanProcessorComponentProvider, ensuring correct configuration parsing, error handling, and integration with ConfigManager.

  • Updated test resources (sdk-config.yaml, sdk-config-bad.yaml) and removed or updated tests that depended on the old parser or processor-adding logic. [1] [2] [3] [4] [5]

These changes make profiling configuration more robust and easier to maintain by consolidating related logic and ensuring consistent handling across the codebase.

Test services data

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

@cleverchuk
cleverchuk requested review from a team as code owners October 15, 2026 14:03
Copilot AI balanced review requested due to automatic review settings October 15, 2026 14:03

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 declarative smoke-test configuration still uses the removed profiler schema and needs migration.

1 open finding
What changed in this PR

Centralizes profiling configuration in the OpenTelemetry component provider, replacing the custom YAML parser.

Changes:

  • Moves profiler settings into the swo_profiler processor.
  • Replaces parser and automatic-registration tests with provider tests.
  • Removes trace-header and ingestion smoke checks.
File Description
smoke-tests/​src/​test/​java/​com/​solarwinds/​SmokeTestV2.java Removes trace assertions.
smoke-tests/​src/​test/​java/​com/​solarwinds/​SmokeTest.java Removes trace assertions.
smoke-tests/​k6/​basic.js Removes trace-ingestion checks.
sdk-config.yaml Migrates profiler settings.
custom/​src/​test/​resources/​sdk-config.yaml Updates valid profiler configuration.
custom/​src/​test/​resources/​sdk-config-bad.yaml Updates invalid profiler configuration.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​provider/​ProfilingSpanProcessorComponentProviderTest.java Removes old provider-name test.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​ProfilingSpanProcessorComponentProviderTest.java Adds provider configuration tests.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​CustomConfigCustomizerProviderTest.java Removes automatic-registration tests.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​ProfilingSettingsParserTest.java Removes parser tests.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​ProfilingSpanProcessorComponentProvider.java Centralizes parsing and configuration.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​CustomConfigCustomizerProvider.java Removes automatic profiler registration.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​ProfilingSettingsParser.java Removes custom parser.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk-config.yaml

@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 in general.
We need to use snake_case for the configuration.

JavaRuntimeVersionChecker.isJdkVersionSupported()
&& profilerSettings.getBoolean("enabled", false);
int circuitBreakerDurationThreshold =
profilerSettings.getInt("circuitBreakerDurationThreshold", 100);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

use snake case to conform the SDK declarative configuration spec.

…unit tests coverage.

This done to remove the backend from the test since it's not reliable.

@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

@cleverchuk
cleverchuk merged commit 48e38d9 into main Oct 15, 2026
17 checks passed
@cleverchuk
cleverchuk deleted the cc/NH-151107 branch October 15, 2026 21:19
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