Skip to content

Fix - Extract shared default properties and disable ServiceInstanceIdResourceProvider(lambda) - #680

Merged
cleverchuk merged 1 commit into
mainfrom
cc/NH-155616
Nov 17, 2026
Merged

cleverchuk merged 1 commit into
mainfrom
cc/NH-155616

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

TL;DR

The javaagent and the Lambda extension each set the same OTel default properties in their own supplier. This PR moves those defaults into one SharedPropertiesSupplier that both distributions register. As a result, Lambda now also disables the upstream ServiceInstanceIdResourceProvider, as the agent has done since #679, so both distributions get service.instance.id from ApmResourceProvider.

Motivation

#679 disabled ServiceInstanceIdResourceProvider only in the agent's SolarwindsPropertiesSupplier. However, ApmResourceProvider, which now sets service.instance.id, lives in the shared library and runs in Lambda too. In Lambda, both providers therefore set service.instance.id, and the value that wins depends on the order the providers run in.

Several other defaults were also copied into both suppliers, so the two could drift apart. Keeping one source of truth for the common defaults avoids that.

Changes

  • New SharedPropertiesSupplier (shared library) with the common defaults:
    • otel.java.experimental.span-stacktrace.filter → SolarWinds span stacktrace filter
    • otel.semconv-stability.opt-in=database/dup
    • otel.exporter.otlp.metrics.temporality.preference=delta
    • otel.exporter.otlp.metrics.default.histogram.aggregation=base2_exponential_bucket_histogram
    • otel.java.disabled.resource.providers=io.opentelemetry.sdk.autoconfigure.ServiceInstanceIdResourceProvider
  • Agent (AutoConfigurationCustomizerProviderImpl) registers SharedPropertiesSupplier before SolarwindsPropertiesSupplier. The shared keys were removed from SolarwindsPropertiesSupplier.
  • Lambda (DefaultAutoConfigurationCustomizerProvider) registers SharedPropertiesSupplier before PropertiesSupplier. The shared keys were removed from PropertiesSupplier.

Behavior changes

  • Lambda: ServiceInstanceIdResourceProvider is now disabled. service.instance.id comes only from ApmResourceProvider (a random UUID per process).

Testing

  • SharedPropertiesSupplierTest checks each shared default value.
  • AutoConfigurationCustomizerProviderImplTest and DefaultAutoConfigurationCustomizerProviderTest verify that both the shared supplier and the distribution's own supplier are registered.

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 November 17, 2026 00:31
Copilot AI balanced review requested due to automatic review settings November 17, 2026 00:31

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.

🟢 Approval recommended

No active review issues are identified for the change centralizing shared OpenTelemetry defaults.

No open issues 🎉

What changed in this PR

Centralizes shared OpenTelemetry defaults for the Java agent and Lambda extension. This extends #679’s provider-disable setting to Lambda, preventing competing providers from setting service.instance.id.

Changes:

  • Extracts five common defaults into SharedPropertiesSupplier.
  • Registers the shared supplier before each distribution-specific supplier and removes duplicated defaults.
  • Adds tests for shared values and updates tests to verify supplier registration.
File Description
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​SharedPropertiesSupplierTest.java Verifies all five shared default values.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​SharedPropertiesSupplier.java Defines common defaults, including disabling the upstream instance-ID provider.
libs/​lambda/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​DefaultAutoConfigurationCustomizerProviderTest.java Verifies registration of both Lambda suppliers.
libs/​lambda/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​PropertiesSupplier.java Removes defaults moved to the shared supplier.
libs/​lambda/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​DefaultAutoConfigurationCustomizerProvider.java Registers shared defaults before Lambda-specific defaults.
custom/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​provider/​AutoConfigurationCustomizerProviderImplTest.java Verifies registration of both agent suppliers.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​SolarwindsPropertiesSupplier.java Removes defaults moved to the shared supplier.
custom/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​AutoConfigurationCustomizerProviderImpl.java Registers shared defaults before agent-specific defaults.

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

@cleverchuk
cleverchuk merged commit acf4477 into main Nov 17, 2026
18 checks passed
@cleverchuk
cleverchuk deleted the cc/NH-155616 branch November 17, 2026 13:57
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