File tree Expand file tree Collapse file tree
dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import static net .bytebuddy .matcher .ElementMatchers .isPublic ;
1010import static net .bytebuddy .matcher .ElementMatchers .takesArgument ;
1111
12- import com .google .auto .service .AutoService ;
1312import datadog .trace .agent .tooling .Instrumenter ;
14- import datadog .trace .agent .tooling .InstrumenterModule ;
1513import datadog .trace .bootstrap .instrumentation .api .AgentScope ;
1614import datadog .trace .bootstrap .instrumentation .api .AgentSpan ;
1715import net .bytebuddy .asm .Advice ;
1816
19- @ AutoService (InstrumenterModule .class )
20- public final class AerospikeClientInstrumentation extends InstrumenterModule .Tracing
17+ public final class AerospikeClientInstrumentation
2118 implements Instrumenter .ForSingleType , Instrumenter .HasMethodAdvice {
22- public AerospikeClientInstrumentation () {
23- super ("aerospike" );
24- }
25-
2619 @ Override
2720 public String instrumentedType () {
2821 return "com.aerospike.client.AerospikeClient" ;
2922 }
3023
31- @ Override
32- public String [] helperClassNames () {
33- return new String [] {
34- packageName + ".AerospikeClientDecorator" , packageName + ".TracingListener" ,
35- };
36- }
37-
3824 @ Override
3925 public void methodAdvice (MethodTransformer transformer ) {
4026 transformer .applyAdvice (
Original file line number Diff line number Diff line change 1+ package datadog .trace .instrumentation .aerospike4 ;
2+
3+ import static java .util .Collections .singleton ;
4+
5+ import com .google .auto .service .AutoService ;
6+ import datadog .trace .agent .tooling .Instrumenter ;
7+ import datadog .trace .agent .tooling .InstrumenterModule ;
8+ import datadog .trace .api .InstrumenterConfig ;
9+ import java .util .ArrayList ;
10+ import java .util .List ;
11+
12+ @ AutoService (InstrumenterModule .class )
13+ public final class AerospikeModule extends InstrumenterModule {
14+ public AerospikeModule () {
15+ super ("aerospike" );
16+ }
17+
18+ @ Override
19+ public String [] helperClassNames () {
20+ return new String [] {
21+ packageName + ".AerospikeClientDecorator" , packageName + ".TracingListener" ,
22+ };
23+ }
24+
25+ @ Override
26+ public List <Instrumenter > typeInstrumentations () {
27+ final List <Instrumenter > ret = new ArrayList <>(4 );
28+ ret .add (new AerospikeClientInstrumentation ());
29+ ret .add (new CommandInstrumentation ());
30+ if (InstrumenterConfig .get ().isIntegrationEnabled (singleton ("java_concurrent" ), true )) {
31+ ret .add (new NioEventLoopInstrumentation ());
32+ }
33+ ret .add (new PartitionInstrumentation ());
34+ return ret ;
35+ }
36+ }
Original file line number Diff line number Diff line change 1010import com .aerospike .client .cluster .Cluster ;
1111import com .aerospike .client .cluster .Node ;
1212import com .aerospike .client .cluster .Partition ;
13- import com .google .auto .service .AutoService ;
1413import datadog .trace .agent .tooling .Instrumenter ;
15- import datadog .trace .agent .tooling .InstrumenterModule ;
1614import datadog .trace .api .DDSpanTypes ;
1715import datadog .trace .bootstrap .instrumentation .api .AgentSpan ;
1816import net .bytebuddy .asm .Advice ;
1917
20- @ AutoService (InstrumenterModule .class )
21- public final class CommandInstrumentation extends InstrumenterModule .Tracing
18+ public final class CommandInstrumentation
2219 implements Instrumenter .ForSingleType , Instrumenter .HasMethodAdvice {
23- public CommandInstrumentation () {
24- super ("aerospike" );
25- }
2620
2721 @ Override
2822 public String instrumentedType () {
2923 return "com.aerospike.client.command.Command" ;
3024 }
3125
32- @ Override
33- public String [] helperClassNames () {
34- return new String [] {
35- packageName + ".AerospikeClientDecorator" ,
36- };
37- }
38-
3926 @ Override
4027 public void methodAdvice (MethodTransformer transformer ) {
4128 transformer .applyAdvice (
Original file line number Diff line number Diff line change 77import static net .bytebuddy .matcher .ElementMatchers .takesArgument ;
88import static net .bytebuddy .matcher .ElementMatchers .takesArguments ;
99
10- import com .google .auto .service .AutoService ;
1110import datadog .trace .agent .tooling .Instrumenter ;
12- import datadog .trace .agent .tooling .InstrumenterModule ;
1311import java .util .concurrent .FutureTask ;
1412import java .util .concurrent .RunnableFuture ;
1513import net .bytebuddy .asm .Advice ;
1614
17- @ AutoService (InstrumenterModule .class )
18- public final class NioEventLoopInstrumentation extends InstrumenterModule .Tracing
15+ public final class NioEventLoopInstrumentation
1916 implements Instrumenter .ForSingleType , Instrumenter .HasMethodAdvice {
20- public NioEventLoopInstrumentation () {
21- super ("aerospike" , "java_concurrent" );
22- }
2317
2418 @ Override
2519 public String instrumentedType () {
Original file line number Diff line number Diff line change 1111import com .aerospike .client .cluster .Cluster ;
1212import com .aerospike .client .cluster .Node ;
1313import com .aerospike .client .cluster .Partition ;
14- import com .google .auto .service .AutoService ;
1514import datadog .trace .agent .tooling .Instrumenter ;
16- import datadog .trace .agent .tooling .InstrumenterModule ;
1715import datadog .trace .api .DDSpanTypes ;
1816import datadog .trace .bootstrap .instrumentation .api .AgentSpan ;
1917import net .bytebuddy .asm .Advice ;
2018
21- @ AutoService (InstrumenterModule .class )
22- public final class PartitionInstrumentation extends InstrumenterModule .Tracing
19+ public final class PartitionInstrumentation
2320 implements Instrumenter .ForSingleType , Instrumenter .HasMethodAdvice {
24- public PartitionInstrumentation () {
25- super ("aerospike" );
26- }
2721
2822 @ Override
2923 public String instrumentedType () {
3024 return "com.aerospike.client.cluster.Partition" ;
3125 }
3226
33- @ Override
34- public String [] helperClassNames () {
35- return new String [] {
36- packageName + ".AerospikeClientDecorator" ,
37- };
38- }
39-
4027 @ Override
4128 public void methodAdvice (MethodTransformer transformer ) {
4229 transformer .applyAdvice (
You can’t perform that action at this time.
0 commit comments