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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indy instrumentation - leftovers migration #13074
base: main
Are you sure you want to change the base?
indy instrumentation - leftovers migration #13074
Changes from 16 commits
c911faa
26e79f9
7f3ae3b
9183992
29c99dd
45ead47
ba30ba8
eb945b8
eba7e20
7a1cbc7
590f86e
a8cbb24
403caaa
506cc62
da1c13d
c4350d0
1d54a14
03aa810
2ed4e96
77a4f00
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of injecting all the helper did you consider adding a proxy for
AnnotationInstrumentationHelper
similarly toopentelemetry-java-instrumentation/instrumentation/graphql-java/graphql-java-20.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/graphql/v20_0/GraphqlInstrumentationModule.java
Lines 41 to 48 in edbd9aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we have the choice here, as
MethodRequest
is being used directly used inWithSpanInstrumentation
which uses ASM, also ifMethodRequest
is being injected then it's also pullingAnnotationSingletons
which is using it to be injected as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could replace
MethodRequest
withObject
in method signatures. We had similar issue in indy instrumentation where advice methods could not have helper classes in the signature, see #11873 What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that could work, I will try to see if we can easily do it.
If I understand what you aim to achieve here is only exposing the
AnnotationInstrumentationHelper
class to the instrumented code through an injected proxy, and then leave other classes called by the realAnnotationInstrumentationHelper
class implementation as implementation details.One of the downsides of this approach is that we loose the type-safety of the method signatures and need to introduce explicit casts to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented it in 03aa810 and there aren't that many compromises on the code, so I think it was again a great suggestion @laurit !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] this is only used for lambda, and the
ClassFileTransformer
instances that are used here are very specific to lambda instrumentation, so renaming helps keep it clear.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] wrapping at registration time helps to make the consumer transparently use it with java 8 API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] there is no need to maintain an inline and indy variants of this instrumentation, so we only need one that is compatible with both.