Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,18 @@
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;

import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.bootstrap.instrumentation.api.AgentScope;
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import net.bytebuddy.asm.Advice;

@AutoService(InstrumenterModule.class)
public final class AerospikeClientInstrumentation extends InstrumenterModule.Tracing
public final class AerospikeClientInstrumentation
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
public AerospikeClientInstrumentation() {
super("aerospike");
}

@Override
public String instrumentedType() {
return "com.aerospike.client.AerospikeClient";
}

@Override
public String[] helperClassNames() {
return new String[] {
packageName + ".AerospikeClientDecorator", packageName + ".TracingListener",
};
}

@Override
public void methodAdvice(MethodTransformer transformer) {
transformer.applyAdvice(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package datadog.trace.instrumentation.aerospike4;

import static java.util.Collections.singleton;

import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.InstrumenterConfig;
import java.util.ArrayList;
import java.util.List;

@AutoService(InstrumenterModule.class)
public final class AerospikeModule extends InstrumenterModule {
public AerospikeModule() {
super("aerospike");
}

@Override
public String[] helperClassNames() {
return new String[] {
packageName + ".AerospikeClientDecorator", packageName + ".TracingListener",
};
}

@Override
public List<Instrumenter> typeInstrumentations() {
final List<Instrumenter> ret = new ArrayList<>(4);
ret.add(new AerospikeClientInstrumentation());
ret.add(new CommandInstrumentation());
if (InstrumenterConfig.get().isIntegrationEnabled(singleton("java_concurrent"), true)) {
ret.add(new NioEventLoopInstrumentation());
}
ret.add(new PartitionInstrumentation());
return ret;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,19 @@
import com.aerospike.client.cluster.Cluster;
import com.aerospike.client.cluster.Node;
import com.aerospike.client.cluster.Partition;
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.DDSpanTypes;
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import net.bytebuddy.asm.Advice;

@AutoService(InstrumenterModule.class)
public final class CommandInstrumentation extends InstrumenterModule.Tracing
public final class CommandInstrumentation
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
public CommandInstrumentation() {
super("aerospike");
}

@Override
public String instrumentedType() {
return "com.aerospike.client.command.Command";
}

@Override
public String[] helperClassNames() {
return new String[] {
packageName + ".AerospikeClientDecorator",
};
}

@Override
public void methodAdvice(MethodTransformer transformer) {
transformer.applyAdvice(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@
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;
import datadog.trace.agent.tooling.InstrumenterModule;
import java.util.concurrent.FutureTask;
import java.util.concurrent.RunnableFuture;
import net.bytebuddy.asm.Advice;

@AutoService(InstrumenterModule.class)
public final class NioEventLoopInstrumentation extends InstrumenterModule.Tracing
public final class NioEventLoopInstrumentation
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
public NioEventLoopInstrumentation() {
super("aerospike", "java_concurrent");
}

@Override
public String instrumentedType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,19 @@
import com.aerospike.client.cluster.Cluster;
import com.aerospike.client.cluster.Node;
import com.aerospike.client.cluster.Partition;
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.DDSpanTypes;
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import net.bytebuddy.asm.Advice;

@AutoService(InstrumenterModule.class)
public final class PartitionInstrumentation extends InstrumenterModule.Tracing
public final class PartitionInstrumentation
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
public PartitionInstrumentation() {
super("aerospike");
}

@Override
public String instrumentedType() {
return "com.aerospike.client.cluster.Partition";
}

@Override
public String[] helperClassNames() {
return new String[] {
packageName + ".AerospikeClientDecorator",
};
}

@Override
public void methodAdvice(MethodTransformer transformer) {
transformer.applyAdvice(
Expand Down