Skip to content

Commit

Permalink
Make matcher more specific rather than remove arg matcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbenson committed Jul 29, 2021
1 parent 87c4af0 commit aa611e7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import static net.bytebuddy.matcher.ElementMatchers.isPackagePrivate;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static net.bytebuddy.matcher.ElementMatchers.returns;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;

import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
Expand Down Expand Up @@ -102,7 +104,11 @@ public String[] helperClassNames() {
@Override
public void adviceTransformations(AdviceTransformation transformation) {
transformation.applyAdvice(
isMethod().and(isPublic()).and(named("process")),
isMethod()
.and(isPublic())
.and(named("process"))
// Method signature changed in 2.6.
.and(takesArguments(0).or(takesArguments(1).and(takesArgument(0, long.class)))),
StopInstrumentation.class.getName() + "$StopSpanAdvice");
}

Expand Down

0 comments on commit aa611e7

Please sign in to comment.