Skip to content

[wip] add annotation for CL target#18830

Draft
SylvainJuge wants to merge 5 commits into
open-telemetry:mainfrom
SylvainJuge:cl-annotation
Draft

[wip] add annotation for CL target#18830
SylvainJuge wants to merge 5 commits into
open-telemetry:mainfrom
SylvainJuge:cl-annotation

Conversation

@SylvainJuge
Copy link
Copy Markdown
Contributor

@SylvainJuge SylvainJuge commented May 22, 2026

Relates to #18824

  • adds a new ClassLoadingStrategy annotation for packages and classes
  • adds ClassLoadingTarget enum to indicate where a given annotated class/package should be loaded
  • adds ClassLoadingTargetUtil utility to parse this information from bytecode, without loading class.

Example usage in #17720

Things to discuss/improve

  • using an annotation may require to add an extra dependency, this is the case for all the library components which do not have the expected dependency.
  • adding a runtime annotation on class/package could be problematic if the instrumented application attempts to read those class annotations, maybe using a compile-time annotation and store this information elsewhere would avoid such issues.
  • reading information from bytecode at runtime likely implies some overhead, given the knowledge about where a class should be loaded is static using a (generated) name-based heuristic may be faster.
  • as an alternative, we could introduce a new name-based heuristic in InstrumentationModule, when injecting classes each module class would be tested.

@SylvainJuge SylvainJuge changed the title add annotation for CL target [wip] add annotation for CL target May 22, 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.

1 participant