Treat all advice as inline when indy is disabled#17442
Treat all advice as inline when indy is disabled#17442laurit merged 1 commit intoopen-telemetry:mainfrom
Conversation
SylvainJuge
left a comment
There was a problem hiding this comment.
If I understand it correctly, this makes both the indy and inline instrumentation closer by making them both use AdviceInliningPoolStrategy, in one case it will add inline = true and another inline = false on the advice at runtime.
Doing the same directly in advice code would produce a slightly different result as the default value inline = true is omitted from the bytecode created by javac.
For now, the lack of inline attribute in advice method annotation can mean "you can use either indy or inline", do we plan in the future to also remove this and then have: inline = false for indy advice and otherwise consider it to be an inline advice ?
Yes, but imo not really relevant for us. We just need to convince byte-buddy to treat the advice as inline or not depending on how we wish to run the instrumentation.
actually we don't care whether there is a value for that attribute or not we can make it return what we want either way
Eventually we can remove it. Initially we'll always use inline advice regardless of the attribute value. Next we'll stop overriding the value and instead use it to decide how the advice should be applied. For instrumentations that use inline we'll use the inline advice mode and for others we'll use the non-inline indy mode. This hopefully will let us transition towards using indy advice without immediately breaking existing extensions. Inside the agent we'll probably skip introspecting the advice and instead rely on something like the existing |
Currently all our advice is declared as
inline. For indy advice we fake the inline attribute value tofalse. This PR make us fake the inline attribute value totruewhen not using indy. This will let us transition the indy ready modules to useinline=false. Eventually we could detect whether to use inline or non-inline style advice by inspecting the advice classes. For our built in instrumentations we may need to use some other means to communicate that they are indy ready as inspecting all advice classes can be a bit costly.