Skip to content

Breaking - Split host id resource detector into swo_uams and swo_k8s - #645

Merged
cleverchuk merged 1 commit into
mainfrom
cc/NH-152017
Oct 20, 2026
Merged

cleverchuk merged 1 commit into
mainfrom
cc/NH-152017

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

This pull request refactors and modularizes the resource detection and attribute creation logic for OpenTelemetry extensions, with a focus on improving clarity, separation of concerns, and testability. The changes split resource providers into more focused components, update attribute creation utilities, and revise tests to match the new structure.

Key changes include:

Resource Provider Refactoring

  • Split the original ResourceComponentProvider into three distinct providers: ApmResourceComponentProvider, UamsResourceComponentProvider, and a new K8sResourceComponentProvider, each responsible for a specific set of resource attributes. This improves modularity and maintainability. [1] [2] [3]
  • Removed the now-obsolete ResourceArbiter and CustomConfigCustomizerProvider classes, as their responsibilities have been replaced by the new provider structure. [1] [2]

Attribute Utility Improvements

  • Refactored HostIdResourceUtil to provide separate methods for creating UAMS and Kubernetes attributes, ensuring that each attribute set is cleanly separated and only contains relevant keys. The main createAttribute() method now combines these as needed. [1] [2]

Test Updates

  • Overhauled HostIdResourceUtilTest to validate the new attribute creation methods, ensuring that only the intended keys are present in each attribute set and that mappings from metadata are correct.
  • Removed the now-obsolete CustomConfigCustomizerProviderTest since the customization logic has been replaced by the new provider classes.

Naming and Consistency

  • Updated provider class and component names to use a consistent naming scheme (swo_apm, swo_uams, swo_k8s) for clarity and alignment with their respective responsibilities. [1] [2] [3]

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9]

Test services data

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

Copilot AI balanced review requested due to automatic review settings October 19, 2026 18:07
@cleverchuk
cleverchuk requested review from a team as code owners October 19, 2026 18:07

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 partial-configuration test assumes no detected Kubernetes metadata and can fail depending on the host environment.

1 open issue
What changed in this PR

Separates SolarWinds resource detection into focused OpenTelemetry providers with explicit YAML configuration.

Changes:

  • Introduces swo_apm, swo_uams, and swo_k8s detectors.
  • Separates UAMS and Kubernetes attributes and removes automatic detector injection.
  • Updates configuration examples and provider tests.
File Description
smoke-tests/​sdk-config.yaml Enables the three detectors.
sdk-config.yaml Updates example detector configuration.
libs/​shared/​src/​test/​resources/​sdk-config.yaml Configures detectors for shared tests.
custom/​src/​test/​resources/​sdk-config.yaml Configures detectors for custom tests.
custom/​src/​test/​resources/​sdk-config-bad.yaml Updates the invalid-config fixture.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​provider/​ApmResourceComponentProviderTest.java Updates APM provider naming assertions.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​UamsResourceComponentProviderTest.java Updates UAMS provider naming assertions.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​K8sResourceComponentProviderTest.java Tests Kubernetes configuration overrides.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​CustomConfigCustomizerProviderTest.java Removes automatic-injection tests.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​HostIdResourceUtilTest.java Tests separated attribute mappings.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​ResourceArbiter.java Removes the resource arbiter.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​UamsResourceComponentProvider.java Limits detection to UAMS attributes.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​K8sResourceComponentProvider.java Adds Kubernetes detection and overrides.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​CustomConfigCustomizerProvider.java Removes automatic detector injection.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​ApmResourceComponentProvider.java Renames the provider and removes shared state.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​HostIdResourceUtil.java Separates UAMS and Kubernetes attribute creation.

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. I left a nits comment.

@cleverchuk
cleverchuk merged commit 209fc1f into main Oct 20, 2026
18 checks passed
@cleverchuk
cleverchuk deleted the cc/NH-152017 branch October 20, 2026 15:17
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