Preserve Spring resource provider class names#18785
Merged
trask merged 1 commit intoMay 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
@AutoServiceregistrations from the renamedio.opentelemetry.javaagent.instrumentation.spring.boot.resources.*implementations. - Add deprecated
io.opentelemetry.instrumentation.spring.resources.*wrapper classes annotated with@AutoServicethat 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
approved these changes
May 18, 2026
laurit
left a comment
Contributor
There was a problem hiding this comment.
I think it would be enough to just document it as a breaking change in the release notes.
SylvainJuge
pushed a commit
to SylvainJuge/opentelemetry-java-instrumentation
that referenced
this pull request
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.