diff --git a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesExtractor.java b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesExtractor.java index 8418dfd4fa40..c54d42b488db 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesExtractor.java +++ b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesExtractor.java @@ -29,7 +29,7 @@ protected String name(JedisRequest request) { @Override protected String connectionString(JedisRequest request) { - return request.getConnectionString(); + return null; } @Override diff --git a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisRequest.java b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisRequest.java index 94ceab0ba154..d2a304f5111e 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisRequest.java +++ b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisRequest.java @@ -21,10 +21,6 @@ public abstract class JedisRequest { public abstract List getArgs(); - public String getConnectionString() { - return getConnection().getHost() + ":" + getConnection().getPort(); - } - public static JedisRequest create(Connection connection, Protocol.Command command) { return new AutoValue_JedisRequest(connection, command, emptyList()); } diff --git a/instrumentation/jedis/jedis-1.4/javaagent/src/test/groovy/JedisClientTest.groovy b/instrumentation/jedis/jedis-1.4/javaagent/src/test/groovy/JedisClientTest.groovy index 055c3ac8568f..18582ded9ba6 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/src/test/groovy/JedisClientTest.groovy +++ b/instrumentation/jedis/jedis-1.4/javaagent/src/test/groovy/JedisClientTest.groovy @@ -49,7 +49,6 @@ class JedisClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.DB_OPERATION.key" "SET" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -75,7 +74,6 @@ class JedisClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.DB_OPERATION.key" "SET" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -89,7 +87,6 @@ class JedisClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "GET foo" "$SemanticAttributes.DB_OPERATION.key" "GET" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -115,7 +112,6 @@ class JedisClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.DB_OPERATION.key" "SET" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -129,7 +125,6 @@ class JedisClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY" "$SemanticAttributes.DB_OPERATION.key" "RANDOMKEY" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" diff --git a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisClientTracer.java b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisClientTracer.java index c8f8fc6bf2a4..958f0fef93a8 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisClientTracer.java +++ b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisClientTracer.java @@ -47,7 +47,7 @@ protected String dbSystem(Connection connection) { @Override protected String dbConnectionString(Connection connection) { - return connection.getHost() + ":" + connection.getPort(); + return null; } @Override diff --git a/instrumentation/jedis/jedis-3.0/javaagent/src/test/groovy/Jedis30ClientTest.groovy b/instrumentation/jedis/jedis-3.0/javaagent/src/test/groovy/Jedis30ClientTest.groovy index 7c659ebd452a..6b02a99724b6 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/src/test/groovy/Jedis30ClientTest.groovy +++ b/instrumentation/jedis/jedis-3.0/javaagent/src/test/groovy/Jedis30ClientTest.groovy @@ -49,7 +49,6 @@ class Jedis30ClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -75,7 +74,6 @@ class Jedis30ClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -89,7 +87,6 @@ class Jedis30ClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "GET foo" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -115,7 +112,6 @@ class Jedis30ClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" @@ -129,7 +125,6 @@ class Jedis30ClientTest extends AgentInstrumentationSpecification { kind CLIENT attributes { "$SemanticAttributes.DB_SYSTEM.key" "redis" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" diff --git a/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy index 40e73d395c2d..bdc22ec87efe 100644 --- a/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy @@ -48,7 +48,6 @@ class LettuceReactiveClientTest extends AbstractLettuceReactiveClientTest implem "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET a ?" } @@ -67,7 +66,6 @@ class LettuceReactiveClientTest extends AbstractLettuceReactiveClientTest implem "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET a" } diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java index e4b08b0a3cd6..a818f978d821 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java +++ b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java @@ -319,13 +319,5 @@ private void finish(Span span) { private static void fillEndpoint(AttributeSetter span, OpenTelemetryEndpoint endpoint) { span.setAttribute(SemanticAttributes.NET_TRANSPORT, IP_TCP); NetPeerAttributes.INSTANCE.setNetPeer(span, endpoint.name, endpoint.ip, endpoint.port); - - StringBuilder redisUrl = - new StringBuilder("redis://").append(endpoint.name != null ? endpoint.name : endpoint.ip); - if (endpoint.port > 0) { - redisUrl.append(":").append(endpoint.port); - } - - span.setAttribute(SemanticAttributes.DB_CONNECTION_STRING, redisUrl.toString()); } } diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.groovy index b28e8807b318..fd663c4b1ef5 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.groovy @@ -146,7 +146,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET TESTSETKEY ?" } @@ -188,7 +187,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET TESTKEY" } @@ -244,7 +242,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET NON_EXISTENT_KEY" } @@ -286,7 +283,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY" "${SemanticAttributes.DB_SYSTEM.key}" "redis" } @@ -346,7 +342,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "HMSET TESTHM firstname ? lastname ? age ?" } @@ -366,7 +361,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "HGETALL TESTHM" } diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.groovy index 1c975f6f72df..f204e1f0c34b 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.groovy @@ -95,7 +95,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET TESTSETKEY ?" } @@ -128,7 +127,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET TESTKEY" } @@ -169,7 +167,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET NON_EXISTENT_KEY" } @@ -208,7 +205,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY" "${SemanticAttributes.DB_SYSTEM.key}" "redis" } @@ -237,7 +233,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_STATEMENT.key}" "COMMAND" "${SemanticAttributes.DB_SYSTEM.key}" "redis" } @@ -285,7 +280,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET a ?" } @@ -304,7 +298,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET a" } @@ -343,7 +336,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET a ?" } @@ -362,7 +354,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET a" } diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.groovy b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.groovy index cb2b1ff15650..f54964c48de0 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.groovy @@ -70,7 +70,6 @@ abstract class AbstractLettuceSyncClientAuthTest extends InstrumentationSpecific "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "AUTH ?" } diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.groovy index 0d1653b0e2ba..057d184bcd43 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.groovy @@ -133,7 +133,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET TESTSETKEY ?" } @@ -167,7 +166,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://localhost:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SET TESTSETKEY ?" } @@ -197,7 +195,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET TESTKEY" } @@ -227,7 +224,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "GET NON_EXISTENT_KEY" } @@ -257,7 +253,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY" "${SemanticAttributes.DB_SYSTEM.key}" "redis" } @@ -287,7 +282,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "LPUSH TESTLIST ?" } @@ -317,7 +311,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "HMSET user firstname ? lastname ? age ?" } @@ -347,7 +340,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "HGETALL TESTHM" } @@ -382,7 +374,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "EVAL $b64Script 1 TESTLIST ? ?" } @@ -416,7 +407,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "MSET key1 ? key2 ?" } @@ -446,7 +436,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "DEBUG SEGFAULT" } @@ -483,7 +472,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio "${SemanticAttributes.NET_TRANSPORT.key}" IP_TCP "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_PORT.key}" port - "${SemanticAttributes.DB_CONNECTION_STRING.key}" "redis://127.0.0.1:$port" "${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN NOSAVE" if (!Boolean.getBoolean("testLatestDeps")) { diff --git a/instrumentation/redisson-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesExtractor.java b/instrumentation/redisson-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesExtractor.java index a416c5b94aa6..a11c643b593a 100644 --- a/instrumentation/redisson-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesExtractor.java +++ b/instrumentation/redisson-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesExtractor.java @@ -12,7 +12,6 @@ import io.opentelemetry.instrumentation.api.db.RedisCommandSanitizer; import io.opentelemetry.instrumentation.api.instrumenter.db.DbAttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; -import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -43,8 +42,7 @@ protected String name(RedissonRequest request) { @Override protected String connectionString(RedissonRequest request) { - InetSocketAddress remoteAddress = request.getAddress(); - return remoteAddress.getHostString() + ":" + remoteAddress.getPort(); + return null; } @Override diff --git a/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonAsyncClientTest.groovy b/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonAsyncClientTest.groovy index ee4da5092636..2df5f53f57c2 100644 --- a/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonAsyncClientTest.groovy +++ b/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonAsyncClientTest.groovy @@ -71,7 +71,6 @@ class RedissonAsyncClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.DB_OPERATION.key" "SET" @@ -101,7 +100,6 @@ class RedissonAsyncClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "SADD set1 ?" "$SemanticAttributes.DB_OPERATION.key" "SADD" @@ -116,7 +114,6 @@ class RedissonAsyncClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "RPUSH list1 ?" "$SemanticAttributes.DB_OPERATION.key" "RPUSH" diff --git a/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonClientTest.groovy b/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonClientTest.groovy index 5b093352c9a1..b385a78839ea 100644 --- a/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonClientTest.groovy +++ b/instrumentation/redisson-3.0/javaagent/src/test/groovy/RedissonClientTest.groovy @@ -76,7 +76,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "SET foo ?" "$SemanticAttributes.DB_OPERATION.key" "SET" @@ -91,7 +90,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "GET foo" "$SemanticAttributes.DB_OPERATION.key" "GET" @@ -118,7 +116,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "SET batch1 ?;SET batch2 ?" "$SemanticAttributes.DB_OPERATION.key" null @@ -143,7 +140,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "RPUSH list1 ?" "$SemanticAttributes.DB_OPERATION.key" "RPUSH" @@ -171,7 +167,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "EVAL $script 1 map1 ? ?" "$SemanticAttributes.DB_OPERATION.key" "EVAL" @@ -186,7 +181,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "HGET map1 key1" "$SemanticAttributes.DB_OPERATION.key" "HGET" @@ -211,7 +205,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "SADD set1 ?" "$SemanticAttributes.DB_OPERATION.key" "SADD" @@ -240,7 +233,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "ZADD sort_set1 ? ? ? ? ? ?" "$SemanticAttributes.DB_OPERATION.key" "ZADD" @@ -265,7 +257,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" "INCR AtomicLong" "$SemanticAttributes.DB_OPERATION.key" "INCR" @@ -295,7 +286,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" { lockScriptPattern.matcher(it).matches() } "$SemanticAttributes.DB_OPERATION.key" "EVAL" @@ -312,7 +302,6 @@ class RedissonClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1" "$SemanticAttributes.NET_PEER_NAME.key" "localhost" - "$SemanticAttributes.DB_CONNECTION_STRING.key" "localhost:$port" "$SemanticAttributes.NET_PEER_PORT.key" port "$SemanticAttributes.DB_STATEMENT.key" { lockScriptPattern.matcher(it).matches() } "$SemanticAttributes.DB_OPERATION.key" "EVAL"