Skip to content

NH-150778: Bump OTel agent to 2.32.0 and SDK to 1.66.0 - #635

Merged
cleverchuk merged 2 commits into
mainfrom
cc/NH-150778
Oct 8, 2026
Merged

cleverchuk merged 2 commits into
mainfrom
cc/NH-150778

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

TL;DR

Upgrades the OpenTelemetry Java agent (2.31.1 → 2.32.0) and SDK (1.65.0 → 1.66.0), and migrates our declarative-config customizers to the reworked model API in SDK 1.66. No behavior change is intended; the config we inject (resource detectors, processors, sampler, exporters, propagators) is the same.

Why code changes were needed

SDK 1.66 changed the generated declarative-config model classes in ways that break the old customizer code:

  • Fluent withX(...) mutators are now setX(...), and they return this where chaining is used. All customizers were updated accordingly.
  • Typed *PropertyModel wrappers are gone. Extension components (sampler, span/metric/log exporters, span processors, distribution) now take a plain Map<String, Object> through setExtensionProperty(name, map) and are read back via getExtensionProperties(). Components with no options use an empty HashMap.
  • Experimental fields are no longer on the public model. Resource detection and the instrumentation/development node are reached through the internal ResourceModelAccessor and OpenTelemetryConfigurationModelAccessor helpers instead of getDetectionDevelopment() / withInstrumentationDevelopment().
  • Collections can be null. Getters such as getProcessors() and getReaders() no longer return an empty list by default. Each place that copies or streams these lists now null-guards first; otherwise a config with an omitted processors: or readers: key would NPE during customization.

Notable implementation details

  • A small properties(Object... keyValues) helper builds an insertion-ordered LinkedHashMap for exporter options. It replaces long chains of withAdditionalProperty calls and keeps the generated property order deterministic.
  • Stacktrace processor merge: the user-supplied stacktrace/development value is now an untyped object, so it is copied defensively into a new map (only if it is a Map). Our filter is added only when the user has not set one. A user-defined filter always wins.
  • Metric reader: when no readers are configured, the existing MeterProviderModel is updated via setReaders rather than replaced, so any other settings on it (for example views) are preserved.
  • Resource detectors: the detection model is created if absent, and our two detectors are prepended ahead of any existing ones. The detection model is then written back through the accessor, since a newly created instance is no longer attached to the resource automatically.
  • Span processor: addProcessors in the custom module is null-safe for the same reason as the shared module.

Tests

  • Existing tests were ported to the new API (setX, map-based extension properties, accessor helpers).
  • DeclarativeLoaderTest gets model(...) / distribution(...) helpers to build models without repeating the accessor plumbing.
  • Added verifyThatExistingResourceDetectorsArePreservedAfterOurs, which checks that a user-defined detector survives and ours come first.
  • The shared customizer and config resolver tests were updated for the map-based property assertions.

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 7, 2026 20:47
@cleverchuk
cleverchuk requested review from a team as code owners October 7, 2026 20:47

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 newly introduced null-list handling lacks direct regression coverage in both customizers.

2 open findings
What changed in this PR

Upgrades OpenTelemetry dependencies and migrates declarative configuration customizers to the SDK 1.66 model API.

Changes:

  • Bumps the agent to 2.32.0 and SDK to 1.66.0.
  • Migrates extension properties, experimental accessors, and null-list handling.
  • Updates tests and renames the HTTP settings thread.
File Description
dependencyManagement/​build.gradle.kts Updates OpenTelemetry versions.
SharedConfigCustomizerProvider.java Migrates shared configuration customization.
SharedConfigCustomizerProviderTest.java Ports and expands shared customizer tests.
SolarwindsConfigResolverTest.java Updates resolver model construction.
CustomConfigCustomizerProvider.java Migrates resource and processor customization.
CustomConfigCustomizerProviderTest.java Tests resource detector preservation.
DeclarativeLoaderTest.java Ports declarative loader tests.
HttpSettingsFetcher.java Renames the polling thread.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@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 3565c0b into main Oct 8, 2026
30 of 31 checks passed
@cleverchuk
cleverchuk deleted the cc/NH-150778 branch October 8, 2026 16:26
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.

4 participants