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
26 changes: 26 additions & 0 deletions dd-java-agent/instrumentation/redisson-2.0.0/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,39 @@ testSets {
dirName = 'test/redisson20'
}

latestRedisson20ForkedTest {
dirName = 'test/redisson20'
extendsFrom latestRedisson20Test
}

latestRedisson23Test {
dirName = 'test/redisson23'
}

latestRedisson23ForkedTest {
dirName = 'test/redisson23'
extendsFrom latestRedisson23Test
}

latestDepTest {
dirName = 'test/redissonLatest'
}

latestDepForkedTest {
dirName = 'test/redissonLatest'
extendsFrom latestDepTest
}
}
latestRedisson20Test {
finalizedBy latestRedisson20ForkedTest
}

latestRedisson23Test {
finalizedBy latestRedisson20ForkedTest
}

latestDepTest {
finalizedBy latestDepForkedTest
}

tasks.named('test').configure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.ArrayList;
import java.util.List;
import net.bytebuddy.asm.Advice;
import org.redisson.client.RedisConnection;
import org.redisson.client.protocol.CommandData;
import org.redisson.client.protocol.CommandsData;

Expand Down Expand Up @@ -59,9 +60,11 @@ public void adviceTransformations(AdviceTransformation transformation) {
public static class RedissonCommandAdvice {

@Advice.OnMethodEnter(suppress = Throwable.class)
public static AgentScope onEnter(@Advice.Argument(0) final CommandData<?, ?> command) {
public static AgentScope onEnter(
@Advice.Argument(0) final CommandData<?, ?> command, @Advice.This RedisConnection thiz) {
final AgentSpan span = startSpan(RedissonClientDecorator.OPERATION_NAME);
DECORATE.afterStart(span);
DECORATE.onPeerConnection(span, thiz.getRedisClient().getAddr());
DECORATE.onStatement(span, command.getCommand().getName());
return activateSpan(span);
}
Expand All @@ -79,9 +82,12 @@ public static void stopSpan(
public static class RedissonCommandsAdvice {

@Advice.OnMethodEnter(suppress = Throwable.class)
public static AgentScope onEnter(@Advice.Argument(0) final CommandsData command) {
public static AgentScope onEnter(
@Advice.Argument(0) final CommandsData command, @Advice.This final RedisConnection thiz) {
final AgentSpan span = startSpan(RedissonClientDecorator.OPERATION_NAME);
DECORATE.afterStart(span);
DECORATE.onPeerConnection(span, thiz.getRedisClient().getAddr());

List<String> commandResourceNames = new ArrayList<>();
for (CommandData<?, ?> commandData : command.getCommands()) {
commandResourceNames.add(commandData.getCommand().getName());
Expand Down
Loading