remove string constants in advice class and comment fixes
MODIFY
dd-java-agent/instrumentation/lettuce-5/src/main/java8/datadog/trace/instrumentation/lettuce/ConnectionFutureAdvice.java
dd-java-agent/instrumentation/lettuce-5/src/main/java8/datadog/trace/instrumentation/lettuce/ConnectionFutureAdvice.java
@@ -12,10 +12,6 @@ import net.bytebuddy.asm.Advice;
public class ConnectionFutureAdvice {
- public static final String REDIS_URL_TAG_NAME = "db.redis.url";
- public static final String REDIS_DB_INDEX_TAG_NAME = "db.redis.dbIndex";
- public static final String RESOURCE_NAME_PREFIX = "CONNECT:";
-
@Advice.OnMethodEnter(suppress = Throwable.class)
public static Scope startSpan(@Advice.Argument(1) final RedisURI redisURI) {
final Scope scope = GlobalTracer.get().buildSpan("redis.query").startActive(false);
@@ -31,9 +27,9 @@ public class ConnectionFutureAdvice {
Tags.PEER_HOSTNAME.set(span, redisHost);
final String url = redisHost + ":" + redisPort + "/" + redisURI.getDatabase();
- span.setTag(REDIS_URL_TAG_NAME, url);
- span.setTag(REDIS_DB_INDEX_TAG_NAME, redisURI.getDatabase());
- span.setTag(DDTags.RESOURCE_NAME, RESOURCE_NAME_PREFIX + url);
+ span.setTag("db.redis.url", url);
+ span.setTag("db.redis.dbIndex", redisURI.getDatabase());
+ span.setTag(DDTags.RESOURCE_NAME, "CONNECT:" + url);
span.setTag(DDTags.SERVICE_NAME, LettuceInstrumentationUtil.SERVICE_NAME);
span.setTag(DDTags.SPAN_TYPE, LettuceInstrumentationUtil.SERVICE_NAME);

MODIFY
dd-java-agent/instrumentation/lettuce-5/src/main/java8/datadog/trace/instrumentation/lettuce/LettuceAsyncCommandsAdvice.java
dd-java-agent/instrumentation/lettuce-5/src/main/java8/datadog/trace/instrumentation/lettuce/LettuceAsyncCommandsAdvice.java
@@ -18,7 +18,6 @@ public class LettuceAsyncCommandsAdvice {
Map<String, String> commandMap = LettuceInstrumentationUtil.getCommandInfo(command);
String commandName = commandMap.get(LettuceInstrumentationUtil.MAP_KEY_CMD_NAME);
String commandArgs = commandMap.get(LettuceInstrumentationUtil.MAP_KEY_CMD_ARGS);
- ;
final Scope scope =
GlobalTracer.get()

MODIFY
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceAsyncClientTest.groovy
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceAsyncClientTest.groovy
@@ -21,7 +21,6 @@ import java.util.function.BiFunction
import java.util.function.Consumer
import java.util.function.Function
-import static datadog.trace.instrumentation.lettuce.ConnectionFutureAdvice.RESOURCE_NAME_PREFIX
import static datadog.trace.agent.test.ListWriterAssert.assertTraces
class LettuceAsyncClientTest extends AgentTestRunner {
@@ -90,7 +89,7 @@ class LettuceAsyncClientTest extends AgentTestRunner {
serviceName "redis"
operationName "redis.query"
spanType "redis"
- resourceName RESOURCE_NAME_PREFIX + DB_ADDR
+ resourceName "CONNECT:" + DB_ADDR
errored false
tags {
@@ -128,7 +127,7 @@ class LettuceAsyncClientTest extends AgentTestRunner {
serviceName "redis"
operationName "redis.query"
spanType "redis"
- resourceName RESOURCE_NAME_PREFIX + DB_ADDR_NON_EXISTENT
+ resourceName "CONNECT:" + DB_ADDR_NON_EXISTENT
errored true
tags {

MODIFY
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceSyncClientTest.groovy
dd-java-agent/instrumentation/lettuce-5/src/test/groovy/LettuceSyncClientTest.groovy
@@ -9,7 +9,6 @@ import spock.lang.Shared
import java.util.concurrent.CompletionException
-import static datadog.trace.instrumentation.lettuce.ConnectionFutureAdvice.RESOURCE_NAME_PREFIX
import static datadog.trace.agent.test.ListWriterAssert.assertTraces
class LettuceSyncClientTest extends AgentTestRunner {
@@ -74,7 +73,7 @@ class LettuceSyncClientTest extends AgentTestRunner {
serviceName "redis"
operationName "redis.query"
spanType "redis"
- resourceName RESOURCE_NAME_PREFIX + DB_ADDR
+ resourceName "CONNECT:" + DB_ADDR
errored false
tags {
@@ -108,7 +107,7 @@ class LettuceSyncClientTest extends AgentTestRunner {
serviceName "redis"
operationName "redis.query"
spanType "redis"
- resourceName RESOURCE_NAME_PREFIX + DB_ADDR_NON_EXISTENT
+ resourceName "CONNECT:" + DB_ADDR_NON_EXISTENT
errored true
tags {

remove string constants in advice class and comment fixes