Skip to content

Remove special handling for indy instrumentation#17256

Merged
laurit merged 1 commit intoopen-telemetry:mainfrom
laurit:simplify-resource-inject
Apr 7, 2026
Merged

Remove special handling for indy instrumentation#17256
laurit merged 1 commit intoopen-telemetry:mainfrom
laurit:simplify-resource-inject

Conversation

@laurit
Copy link
Copy Markdown
Contributor

@laurit laurit commented Mar 31, 2026

Both indy and injecting instrumentation can just expose the original class bytes when needed. This will get us closer to removing the isIndyModule method that we probably won't need (or at least will need to rename it). With indy the proxy and the original class won't match but that shouldn't be a problem. I think we can probably get rid of the proxy and just expose the helper class, that is in the instrumentation class loader, to the application class loader.

@laurit laurit requested a review from a team as a code owner March 31, 2026 16:44
@trask
Copy link
Copy Markdown
Member

trask commented Mar 31, 2026

@JonasKunz @SylvainJuge can one of you review? thanks!

injector
.proxyBuilder("org.springframework.web.servlet.v3_1.OpenTelemetryHandlerMappingFilter")
.inject(InjectionMode.CLASS_AND_RESOURCE);
.inject(InjectionMode.CLASS_ONLY);
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.

Does this means that the helperResourceBuilder.register(...) call in registerHelperResources is now used to inject the class as a resource and thus we can use CLASS_ONLY ?

If so, does it means that if we promote the injectClasses method later with #16975 we will thus do the opposite change and use only injectClasses to inject the class as class (proxy) and as a resource ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this means that the helperResourceBuilder.register(...) call in registerHelperResources is now used to inject the class as a resource and thus we can use CLASS_ONLY ?

yes, now the resource is registered the same way for indy and non-indy instrumentation

If so, does it means that if we promote the injectClasses method later with #16975 we will thus do the opposite change and use only injectClasses to inject the class as class (proxy) and as a resource ?

I want to try out whether we can replace proxy injection with something simpler.

@laurit laurit merged commit 661c100 into open-telemetry:main Apr 7, 2026
93 checks passed
@laurit laurit deleted the simplify-resource-inject branch April 7, 2026 14:43
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