Skip to content

[wip] remove getModuleGroup#18707

Draft
SylvainJuge wants to merge 26 commits into
open-telemetry:mainfrom
SylvainJuge:module-group
Draft

[wip] remove getModuleGroup#18707
SylvainJuge wants to merge 26 commits into
open-telemetry:mainfrom
SylvainJuge:module-group

Conversation

@SylvainJuge
Copy link
Copy Markdown
Contributor

@SylvainJuge SylvainJuge commented May 12, 2026

Work in progress draft to remove getModuleGroup.

Fixes #17720

Summary

  • introduce a common InstrumentationModuleClassLoader instance for each instrumented classloader
  • make this common classloader include all the agent classes in a list of known packages (hard-coded as a PoC)
  • once we have validated this approach is what we aim to have, we can improve the packaging of the solution:
    • idea 1: use package-info.java + annotation to indicate using common classloader
      • this has the advantage to work transparently even with current class shading.
      • we could generate automatically package-info.java for all packages in libraries, hence making them loaded in the common CL. keeping this manual could also be fine as not all libraries are shared.
      • refactor current instrumentation to only rely on libraries for cross-instrumentation dependencies.
    • idea 2: use heuristic on the package name, for example with *.common.* but that sounds brittle and sensitive to minor inconsistencies in package names.

Step 1: verify we can rely on hard-coded package name.

  • opentelemetry-api-bridge
  • netty
  • hibernate
  • servlet
  • pekko-server
  • akka-http
  • aws-sdk
  • aws-sdk-v2
  • couchbase
  • elasticsearch

Step 2: implement a long-term solution

Copy link
Copy Markdown
Contributor

@JonasKunz JonasKunz left a comment

Choose a reason for hiding this comment

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

Overall approach makes sense to me!
This approach allows to put the shared classes in a library, which can be shared across the modules to make the dependencies explicit.

One suggestion I would have is to maybe not use *.common, but something more obscure like otel_common. Thanks to indy, Instrumentation modules can use libraries/dependencies without polluting the instrumented classpath. The *.common package name pattern could be coincidentally used in those libraries, while for something like otel_common this won't happen.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 20, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

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.

invokedynamic : remove/replace getModuleGroup

2 participants