Skip to content

Commit

Permalink
fix CallDepthThreadLocalMap access issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwen624 committed Nov 12, 2021
1 parent 0ee0b54 commit 39b0e17
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.opentelemetry.context.Context;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
//import io.opentelemetry.javaagent.instrumentation.api.CallDepthThreadLocalMap;
import io.opentelemetry.javaagent.instrumentation.api.CallDepth;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
Expand Down Expand Up @@ -47,10 +47,9 @@ public static class StatementAdvice {
//@Advice.OnMethodEnter(suppress = Throwable.class)
@Advice.OnMethodEnter
public static void onEnter() {
// TODO: CallDepthThreadLocalMap is no longer public. See what we can do
// if (CallDepthThreadLocalMap.getCallDepth(Statement.class).get() != 1) { //only report back when depth is one to avoid duplications
// return;
// }
if (CallDepth.forClass(Statement.class).get() != 1) { //only report back when depth is one to avoid duplications
return;
}
AoStatementTracer.writeStackTrace(Context.current());
}
}
Expand Down

0 comments on commit 39b0e17

Please sign in to comment.