|
5 | 5 | import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
6 | 6 |
|
7 | 7 | import com.google.auto.service.AutoService;
|
| 8 | +import datadog.trace.agent.tooling.ExcludeFilterProvider; |
8 | 9 | import datadog.trace.agent.tooling.Instrumenter;
|
9 | 10 | import datadog.trace.bootstrap.ContextStore;
|
10 | 11 | import datadog.trace.bootstrap.InstrumentationContext;
|
| 12 | +import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; |
| 13 | +import java.util.Collection; |
| 14 | +import java.util.Collections; |
11 | 15 | import java.util.Map;
|
12 | 16 | import net.bytebuddy.asm.Advice;
|
13 | 17 | import zio.Fiber;
|
14 | 18 | import zio.Supervisor;
|
15 | 19 |
|
16 | 20 | @AutoService(Instrumenter.class)
|
17 | 21 | public class ZioRuntimeInstrumentation extends Instrumenter.Tracing
|
18 |
| - implements Instrumenter.ForSingleType { |
| 22 | + implements Instrumenter.ForSingleType, ExcludeFilterProvider { |
19 | 23 |
|
20 | 24 | public ZioRuntimeInstrumentation() {
|
21 | 25 | super("zio.experimental");
|
@@ -47,6 +51,12 @@ public Map<String, String> contextStore() {
|
47 | 51 | return singletonMap("zio.Fiber$Runtime", packageName + ".FiberContext");
|
48 | 52 | }
|
49 | 53 |
|
| 54 | + @Override |
| 55 | + public Map<ExcludeFilter.ExcludeType, ? extends Collection<String>> excludedClasses() { |
| 56 | + return Collections.singletonMap( |
| 57 | + ExcludeFilter.ExcludeType.RUNNABLE, Collections.singletonList("zio.internal.FiberRuntime")); |
| 58 | + } |
| 59 | + |
50 | 60 | public static final class DefaultSupervisor {
|
51 | 61 | @Advice.OnMethodExit(suppress = Throwable.class)
|
52 | 62 | public static void onExit(@Advice.Return(readOnly = false) Supervisor<?> supervisor) {
|
|
0 commit comments