diff --git a/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/java/CassandraClientTest.java b/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/java/CassandraClientTest.java index 3373c0e76277..68fca3ee8d67 100644 --- a/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/java/CassandraClientTest.java +++ b/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/java/CassandraClientTest.java @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS; @@ -102,7 +103,7 @@ void syncTest(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasNoParent() .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), @@ -116,7 +117,7 @@ void syncTest(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasNoParent() .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), @@ -135,7 +136,7 @@ void syncTest(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasNoParent() .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), @@ -174,7 +175,7 @@ void asyncTest(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasNoParent() .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), @@ -189,7 +190,7 @@ void asyncTest(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), @@ -213,7 +214,7 @@ void asyncTest(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), diff --git a/instrumentation/cassandra/cassandra-4-common/testing/src/main/java/io/opentelemetry/cassandra/v4/common/AbstractCassandraTest.java b/instrumentation/cassandra/cassandra-4-common/testing/src/main/java/io/opentelemetry/cassandra/v4/common/AbstractCassandraTest.java index b49fb7da01ab..6ed9ba013027 100644 --- a/instrumentation/cassandra/cassandra-4-common/testing/src/main/java/io/opentelemetry/cassandra/v4/common/AbstractCassandraTest.java +++ b/instrumentation/cassandra/cassandra-4-common/testing/src/main/java/io/opentelemetry/cassandra/v4/common/AbstractCassandraTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.cassandra.v4.common; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; @@ -104,10 +105,15 @@ void syncTest(Parameter parameter) { .hasAttributesSatisfyingExactly( satisfies( NETWORK_TYPE, - val -> + val -> { + if (emitStableDatabaseSemconv()) { + val.isNull(); + } else { val.satisfiesAnyOf( v -> assertThat(v).isEqualTo("ipv4"), - v -> assertThat(v).isEqualTo("ipv6"))), + v -> assertThat(v).isEqualTo("ipv6")); + } + }), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), @@ -158,10 +164,15 @@ void asyncTest(Parameter parameter) throws Exception { .hasAttributesSatisfyingExactly( satisfies( NETWORK_TYPE, - val -> + val -> { + if (emitStableDatabaseSemconv()) { + val.isNull(); + } else { val.satisfiesAnyOf( v -> assertThat(v).isEqualTo("ipv4"), - v -> assertThat(v).isEqualTo("ipv6"))), + v -> assertThat(v).isEqualTo("ipv6")); + } + }), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), diff --git a/instrumentation/cassandra/cassandra-4.4/testing/src/main/java/io/opentelemetry/testing/cassandra/v4_4/AbstractCassandra44Test.java b/instrumentation/cassandra/cassandra-4.4/testing/src/main/java/io/opentelemetry/testing/cassandra/v4_4/AbstractCassandra44Test.java index a5319f49df4e..f670596b0953 100644 --- a/instrumentation/cassandra/cassandra-4.4/testing/src/main/java/io/opentelemetry/testing/cassandra/v4_4/AbstractCassandra44Test.java +++ b/instrumentation/cassandra/cassandra-4.4/testing/src/main/java/io/opentelemetry/testing/cassandra/v4_4/AbstractCassandra44Test.java @@ -5,6 +5,7 @@ package io.opentelemetry.testing.cassandra.v4_4; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; @@ -64,10 +65,15 @@ void reactiveTest(Parameter parameter) { .hasAttributesSatisfyingExactly( satisfies( NETWORK_TYPE, - val -> + val -> { + if (emitStableDatabaseSemconv()) { + val.isNull(); + } else { val.satisfiesAnyOf( v -> assertThat(v).isEqualTo("ipv4"), - v -> assertThat(v).isEqualTo("ipv6"))), + v -> assertThat(v).isEqualTo("ipv6")); + } + }), equalTo(SERVER_ADDRESS, cassandraHost), equalTo(SERVER_PORT, cassandraPort), equalTo(NETWORK_PEER_ADDRESS, cassandraIp), diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/AbstractElasticsearch6TransportClientTest.java b/instrumentation/elasticsearch/elasticsearch-transport-6.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/AbstractElasticsearch6TransportClientTest.java index b36d5210f9cd..8995dfd1f7ce 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/AbstractElasticsearch6TransportClientTest.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/AbstractElasticsearch6TransportClientTest.java @@ -7,6 +7,7 @@ import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING; +import io.opentelemetry.instrumentation.api.internal.SemconvStability; import io.opentelemetry.javaagent.instrumentation.elasticsearch.transport.AbstractElasticsearchTransportClientTest; import java.io.File; import java.util.Collections; @@ -111,6 +112,6 @@ protected int getPort() { @Override protected boolean hasNetworkType() { - return true; + return SemconvStability.emitOldDatabaseSemconv(); } } diff --git a/instrumentation/jedis/jedis-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/Jedis30ClientTest.java b/instrumentation/jedis/jedis-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/Jedis30ClientTest.java index 921610937bc1..8b6af1615193 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/Jedis30ClientTest.java +++ b/instrumentation/jedis/jedis-3.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/Jedis30ClientTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.javaagent.instrumentation.jedis.v3_0; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; @@ -85,7 +86,7 @@ void setCommand() { equalTo(maybeStable(DB_OPERATION), "SET"), equalTo(SERVER_ADDRESS, host), equalTo(SERVER_PORT, port), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), satisfies(NETWORK_PEER_PORT, AbstractLongAssert::isNotNegative)))); } @@ -109,7 +110,7 @@ void getCommand() { equalTo(maybeStable(DB_OPERATION), "SET"), equalTo(SERVER_ADDRESS, host), equalTo(SERVER_PORT, port), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), satisfies(NETWORK_PEER_PORT, AbstractLongAssert::isNotNegative))), trace -> @@ -123,7 +124,7 @@ void getCommand() { equalTo(maybeStable(DB_OPERATION), "GET"), equalTo(SERVER_ADDRESS, host), equalTo(SERVER_PORT, port), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), satisfies(NETWORK_PEER_PORT, AbstractLongAssert::isNotNegative)))); } @@ -147,7 +148,7 @@ void commandWithNoArguments() { equalTo(maybeStable(DB_OPERATION), "SET"), equalTo(SERVER_ADDRESS, host), equalTo(SERVER_PORT, port), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), satisfies(NETWORK_PEER_PORT, AbstractLongAssert::isNotNegative))), trace -> @@ -161,7 +162,7 @@ void commandWithNoArguments() { equalTo(maybeStable(DB_OPERATION), "RANDOMKEY"), equalTo(SERVER_ADDRESS, host), equalTo(SERVER_PORT, port), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), satisfies(NETWORK_PEER_PORT, AbstractLongAssert::isNotNegative)))); } diff --git a/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java b/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java index 9e965ee16b99..fa16b2f762b0 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java +++ b/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.javaagent.instrumentation.jedis.v4_0; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS; @@ -76,7 +77,7 @@ void setCommand() { equalTo(DB_SYSTEM, "redis"), equalTo(maybeStable(DB_STATEMENT), "SET foo ?"), equalTo(maybeStable(DB_OPERATION), "SET"), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_PORT, port), equalTo(NETWORK_PEER_ADDRESS, ip)))); } @@ -98,7 +99,7 @@ void getCommand() { equalTo(DB_SYSTEM, "redis"), equalTo(maybeStable(DB_STATEMENT), "SET foo ?"), equalTo(maybeStable(DB_OPERATION), "SET"), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_PORT, port), equalTo(NETWORK_PEER_ADDRESS, ip))), trace -> @@ -110,7 +111,7 @@ void getCommand() { equalTo(DB_SYSTEM, "redis"), equalTo(maybeStable(DB_STATEMENT), "GET foo"), equalTo(maybeStable(DB_OPERATION), "GET"), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_PORT, port), equalTo(NETWORK_PEER_ADDRESS, ip)))); } @@ -132,7 +133,7 @@ void commandWithNoArguments() { equalTo(DB_SYSTEM, "redis"), equalTo(maybeStable(DB_STATEMENT), "SET foo ?"), equalTo(maybeStable(DB_OPERATION), "SET"), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_PORT, port), equalTo(NETWORK_PEER_ADDRESS, ip))), trace -> @@ -144,7 +145,7 @@ void commandWithNoArguments() { equalTo(DB_SYSTEM, "redis"), equalTo(maybeStable(DB_STATEMENT), "RANDOMKEY"), equalTo(maybeStable(DB_OPERATION), "RANDOMKEY"), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_PORT, port), equalTo(NETWORK_PEER_ADDRESS, ip)))); } diff --git a/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.java b/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.java index 4324b7cc1199..9718765f5db3 100644 --- a/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.java +++ b/instrumentation/lettuce/lettuce-5.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.javaagent.instrumentation.lettuce.v5_1; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS; @@ -59,7 +60,8 @@ void testAsyncSubscriberWithSpecificThreadPool() { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -75,7 +77,8 @@ void testAsyncSubscriberWithSpecificThreadPool() { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.java b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.java index 9a65d02a37f3..ce3b521ac190 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.java +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceAsyncClientTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.lettuce.v5_1; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS; @@ -161,7 +162,8 @@ void testSetCommandUsingFutureGetWithTimeout() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -207,7 +209,9 @@ void testGetCommandChainedWithThenAccept() throws Exception { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -286,7 +290,9 @@ void testGetNonExistentKeyCommandWithHandleAsyncAndChainedWithThenApply() throws .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -353,7 +359,9 @@ void testCommandWithNoArgumentsUsingBiconsumer() throws Exception { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -413,7 +421,8 @@ void testHashSetAndThenNestApplyToHashGetall() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -432,7 +441,8 @@ void testHashSetAndThenNestApplyToHashGetall() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.java b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.java index 93b20a87be7b..277bcac75ad4 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.java +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceReactiveClientTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.lettuce.v5_1; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS; @@ -99,7 +100,8 @@ void testSetCommandWithSubscribeOnDefinedConsumer() throws Exception { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -138,7 +140,8 @@ void testGetCommandWithLambdaFunction() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -188,7 +191,8 @@ void testGetNonExistentKeyCommand() throws Exception { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -226,7 +230,8 @@ void testCommandWithNoArguments() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -251,7 +256,8 @@ void testCommandFluxPublisher() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -297,7 +303,8 @@ void testBlockingSubscriber() { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -313,7 +320,8 @@ void testBlockingSubscriber() { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -343,7 +351,8 @@ void testAsyncSubscriber() { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -359,7 +368,8 @@ void testAsyncSubscriber() { .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.java b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.java index 76a467798000..d0cf85fe6a43 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.java +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.lettuce.v5_1; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; @@ -76,7 +77,9 @@ void testAuthCommand() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -92,7 +95,9 @@ void testAuthCommand() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -109,7 +114,9 @@ void testAuthCommand() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -130,7 +137,9 @@ void testAuthCommand() throws Exception { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), diff --git a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.java b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.java index f09ec6b687c2..d4138337676f 100644 --- a/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.java +++ b/instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.lettuce.v5_1; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; @@ -125,7 +126,8 @@ void testSetCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -151,7 +153,8 @@ void testGetCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -177,7 +180,8 @@ void testGetNonExistentKeyCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -203,7 +207,8 @@ void testCommandWithNoArguments() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -239,7 +244,8 @@ void testListCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), @@ -265,7 +271,8 @@ void testHashSetCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -293,7 +300,8 @@ void testHashGetallCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -326,7 +334,8 @@ void testEvalCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -355,7 +364,8 @@ void testMsetCommand() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, port), equalTo(SERVER_ADDRESS, host), @@ -385,7 +395,9 @@ void testDebugSegfaultCommandWithNoArgumentProducesNoSpan() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), @@ -401,7 +413,9 @@ void testDebugSegfaultCommandWithNoArgumentProducesNoSpan() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), @@ -418,7 +432,9 @@ void testDebugSegfaultCommandWithNoArgumentProducesNoSpan() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), @@ -435,7 +451,9 @@ void testDebugSegfaultCommandWithNoArgumentProducesNoSpan() { .hasKind(SpanKind.CLIENT) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, + emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), @@ -475,7 +493,8 @@ void testShutdownCommandProducesNoSpan() { .hasException(new RedisException("Connection disconnected")) .hasAttributesSatisfyingExactly( addExtraAttributes( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), @@ -491,7 +510,8 @@ void testShutdownCommandProducesNoSpan() { addExtraAttributes( equalTo( AttributeKey.stringKey("error"), "Connection disconnected"), - equalTo(NETWORK_TYPE, "ipv4"), + equalTo( + NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, containerConnection.port), equalTo(SERVER_ADDRESS, host), diff --git a/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java b/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java index 219884a0415f..525db6ff8e9e 100644 --- a/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java +++ b/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonAsyncClientTest.java @@ -7,6 +7,7 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.INTERNAL; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanKind; import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanName; @@ -121,7 +122,7 @@ void futureSet() throws ExecutionException, InterruptedException, TimeoutExcepti span.hasName("SET") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -154,7 +155,7 @@ void futureWhenComplete() throws ExecutionException, InterruptedException, Timeo span.hasName("SADD") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -228,7 +229,7 @@ void atomicBatchCommand() throws ExecutionException, InterruptedException, Timeo span.hasName("DB Query") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -238,7 +239,7 @@ void atomicBatchCommand() throws ExecutionException, InterruptedException, Timeo span.hasName("SET") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -249,7 +250,7 @@ void atomicBatchCommand() throws ExecutionException, InterruptedException, Timeo span.hasName("EXEC") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), diff --git a/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java b/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java index 81360d8edb1c..5a328ab240cd 100644 --- a/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java +++ b/instrumentation/redisson/redisson-common/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java @@ -7,6 +7,7 @@ import static io.opentelemetry.api.trace.SpanKind.CLIENT; import static io.opentelemetry.api.trace.SpanKind.INTERNAL; +import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv; import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable; import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanKind; import static io.opentelemetry.instrumentation.testing.util.TelemetryDataUtil.orderByRootSpanName; @@ -124,7 +125,7 @@ void stringCommand() { span.hasName("SET") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -136,7 +137,7 @@ void stringCommand() { span.hasName("GET") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -162,7 +163,7 @@ void batchCommand() span.hasName("DB Query") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -202,7 +203,7 @@ void atomicBatchCommand() { span.hasName("DB Query") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -212,7 +213,7 @@ void atomicBatchCommand() { span.hasName("SET") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -223,7 +224,7 @@ void atomicBatchCommand() { span.hasName("EXEC") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -245,7 +246,7 @@ void listCommand() { span.hasName("RPUSH") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -270,7 +271,7 @@ void hashCommand() { span.hasName("EVAL") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -284,7 +285,7 @@ void hashCommand() { span.hasName("HGET") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -305,7 +306,7 @@ void setCommand() { span.hasName("SADD") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -333,7 +334,7 @@ void sortedSetCommand() span.hasName("ZADD") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -359,7 +360,7 @@ void atomicLongCommand() { span.hasName("INCR") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -385,7 +386,7 @@ void lockCommand() { span.hasName("EVAL") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -400,7 +401,7 @@ void lockCommand() { span.hasName("EVAL") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"), @@ -416,7 +417,7 @@ void lockCommand() { span.hasName("DEL") .hasKind(CLIENT) .hasAttributesSatisfyingExactly( - equalTo(NETWORK_TYPE, "ipv4"), + equalTo(NETWORK_TYPE, emitStableDatabaseSemconv() ? null : "ipv4"), equalTo(NETWORK_PEER_ADDRESS, ip), equalTo(NETWORK_PEER_PORT, (long) port), equalTo(DB_SYSTEM, "redis"),