1
1
package datadog .trace .instrumentation .java .concurrent .structuredconcurrency ;
2
2
3
3
import static datadog .trace .bootstrap .instrumentation .java .concurrent .AdviceUtils .capture ;
4
- import static datadog .trace .bootstrap .instrumentation .java .concurrent .ExcludeFilter .ExcludeType .FORK_JOIN_TASK ;
5
- import static java .util .Collections .singleton ;
6
4
import static java .util .Collections .singletonMap ;
7
5
import static net .bytebuddy .matcher .ElementMatchers .isConstructor ;
8
6
9
7
import com .google .auto .service .AutoService ;
10
- import datadog .trace .agent .tooling .ExcludeFilterProvider ;
11
8
import datadog .trace .agent .tooling .Instrumenter ;
12
9
import datadog .trace .agent .tooling .InstrumenterModule ;
13
10
import datadog .trace .api .Platform ;
14
11
import datadog .trace .bootstrap .ContextStore ;
15
12
import datadog .trace .bootstrap .InstrumentationContext ;
16
- import datadog .trace .bootstrap .instrumentation .java .concurrent .ExcludeFilter ;
17
13
import datadog .trace .bootstrap .instrumentation .java .concurrent .State ;
18
- import java .util .Collection ;
19
14
import java .util .Map ;
20
15
import net .bytebuddy .asm .Advice ;
21
16
27
22
@ SuppressWarnings ("unused" )
28
23
@ AutoService (InstrumenterModule .class )
29
24
public class StructuredTaskScopeInstrumentation extends InstrumenterModule .Tracing
30
- implements Instrumenter .ForBootstrap ,
31
- Instrumenter .ForSingleType ,
32
- Instrumenter .HasMethodAdvice ,
33
- ExcludeFilterProvider {
25
+ implements Instrumenter .ForBootstrap , Instrumenter .ForSingleType , Instrumenter .HasMethodAdvice {
34
26
35
27
public StructuredTaskScopeInstrumentation () {
36
28
super ("java_concurrent" , "structured_task_scope" );
@@ -57,14 +49,6 @@ public void methodAdvice(MethodTransformer transformer) {
57
49
transformer .applyAdvice (isConstructor (), getClass ().getName () + "$ConstructorAdvice" );
58
50
}
59
51
60
- @ Override
61
- public Map <ExcludeFilter .ExcludeType , ? extends Collection <String >> excludedClasses () {
62
- // Prevent the ForkJoinPool instrumentation to enable the task scope too early on the carrier
63
- // thread rather than on the expected running thread, which is virtual by default.
64
- return singletonMap (
65
- FORK_JOIN_TASK , singleton ("java.util.concurrent.ForkJoinTask$RunnableExecuteAction" ));
66
- }
67
-
68
52
public static final class ConstructorAdvice {
69
53
@ Advice .OnMethodExit
70
54
public static <T > void captureScope (
0 commit comments