Skip to content

Preserve Spring resource provider class names#18785

Merged
trask merged 1 commit into
open-telemetry:mainfrom
trask:spring-resource-provider-fqcn-compat-18746
May 18, 2026
Merged

Preserve Spring resource provider class names#18785
trask merged 1 commit into
open-telemetry:mainfrom
trask:spring-resource-provider-fqcn-compat-18746

Conversation

@trask

@trask trask commented May 18, 2026

Copy link
Copy Markdown
Member

Follow up to #18746 by keeping the old Spring Boot resource provider class names as deprecated AutoService wrappers while the implementation remains in the javaagent package. This preserves existing resource-provider configuration that names the providers by FQCN until the wrappers can be removed in 3.0.

@trask trask marked this pull request as ready for review May 18, 2026 16:31
Copilot AI review requested due to automatic review settings May 18, 2026 16:31
@trask trask requested a review from a team as a code owner May 18, 2026 16:31
@trask trask added this to the v2.28.0 milestone May 18, 2026

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.

Pull request overview

This PR restores backward compatibility for Spring Boot resource-provider configuration by reintroducing the previous provider FQCNs as deprecated @AutoService wrapper classes, while keeping the real implementations in the io.opentelemetry.javaagent.* package (per the package normalization work in #18746).

Changes:

  • Remove @AutoService registrations from the renamed io.opentelemetry.javaagent.instrumentation.spring.boot.resources.* implementations.
  • Add deprecated io.opentelemetry.instrumentation.spring.resources.* wrapper classes annotated with @AutoService that extend the new implementations, preserving prior FQCN-based configuration.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
instrumentation/spring/spring-boot-resources/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/boot/resources/SpringResourceComponentProvider.java Removes @AutoService from the implementation class so registration is provided by the compatibility wrapper.
instrumentation/spring/spring-boot-resources/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/boot/resources/SpringBootServiceVersionDetector.java Removes @AutoService from the implementation class so registration is provided by the compatibility wrapper.
instrumentation/spring/spring-boot-resources/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/boot/resources/SpringBootServiceNameDetector.java Removes @AutoService/ResourceProvider import, leaving implementation to be registered via the compatibility wrapper.
instrumentation/spring/spring-boot-resources/javaagent/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringResourceComponentProvider.java Adds deprecated @AutoService wrapper preserving the old ComponentProvider FQCN.
instrumentation/spring/spring-boot-resources/javaagent/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceVersionDetector.java Adds deprecated @AutoService wrapper preserving the old ResourceProvider FQCN.
instrumentation/spring/spring-boot-resources/javaagent/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameDetector.java Adds deprecated @AutoService wrapper preserving the old ResourceProvider FQCN.

@laurit laurit 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.

I think it would be enough to just document it as a breaking change in the release notes.

@trask trask merged commit f6f123d into open-telemetry:main May 18, 2026
99 checks passed
@trask trask deleted the spring-resource-provider-fqcn-compat-18746 branch May 18, 2026 18:06
SylvainJuge pushed a commit to SylvainJuge/opentelemetry-java-instrumentation that referenced this pull request May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants