1
1
package datadog .trace .instrumentation .mule4 ;
2
2
3
+ import static datadog .trace .agent .tooling .bytebuddy .matcher .NameMatchers .named ;
4
+ import static datadog .trace .agent .tooling .bytebuddy .matcher .NameMatchers .namedOneOf ;
5
+ import static net .bytebuddy .matcher .ElementMatchers .isMethod ;
6
+ import static net .bytebuddy .matcher .ElementMatchers .takesArgument ;
7
+
3
8
import com .google .auto .service .AutoService ;
4
9
import datadog .trace .agent .tooling .Instrumenter ;
5
10
import datadog .trace .agent .tooling .InstrumenterModule ;
6
- import datadog .trace .agent .tooling .bytebuddy .matcher .NameMatchers ;
7
11
import datadog .trace .bootstrap .InstrumentationContext ;
8
12
import datadog .trace .bootstrap .instrumentation .api .AgentScope ;
9
13
import datadog .trace .bootstrap .instrumentation .api .AgentTracer ;
10
14
import net .bytebuddy .asm .Advice ;
11
- import net .bytebuddy .matcher .ElementMatchers ;
12
15
import org .mule .runtime .api .event .EventContext ;
13
16
import org .mule .runtime .core .api .event .CoreEvent ;
14
17
import org .mule .runtime .tracer .api .EventTracer ;
18
21
* handler.
19
22
*/
20
23
@ AutoService (InstrumenterModule .class )
21
- public class ComponentMessageInstrumentation extends AbstractMuleInstrumentation
24
+ public class ComponentMessageProcessorInstrumentation extends AbstractMuleInstrumentation
22
25
implements Instrumenter .ForSingleType {
23
26
24
27
@ Override
@@ -29,11 +32,9 @@ public String instrumentedType() {
29
32
@ Override
30
33
public void methodAdvice (MethodTransformer transformer ) {
31
34
transformer .applyAdvice (
32
- ElementMatchers .isMethod ()
33
- .and (NameMatchers .namedOneOf ("onEvent" , "onEventSynchronous" ))
34
- .and (
35
- ElementMatchers .takesArgument (
36
- 0 , NameMatchers .named ("org.mule.runtime.core.api.event.CoreEvent" ))),
35
+ isMethod ()
36
+ .and (namedOneOf ("onEvent" , "onEventSynchronous" , "prepareAndExecuteOperation" ))
37
+ .and (takesArgument (0 , named ("org.mule.runtime.core.api.event.CoreEvent" ))),
37
38
getClass ().getName () + "$ProcessAdvice" );
38
39
}
39
40
0 commit comments