From 34eba4fac0dab42a9b555b082de6dc8e602d2115 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Wed, 10 Apr 2024 16:20:04 +0300 Subject: [PATCH 1/2] Remove db.connection_string --- .../db/DbClientCommonAttributesExtractor.java | 5 - .../db/DbClientCommonAttributesGetter.java | 6 +- .../db/DbClientAttributesExtractorTest.java | 8 - .../db/SqlClientAttributesExtractorTest.java | 8 - .../v3_0/CassandraSqlAttributesGetter.java | 6 - .../v4_0/CassandraSqlAttributesGetter.java | 6 - .../v4_4/CassandraSqlAttributesGetter.java | 6 - .../v2_0/CouchbaseAttributesGetter.java | 6 - .../ElasticsearchDbAttributesGetter.java | 6 - ...lasticsearchTransportAttributesGetter.java | 6 - .../geode/GeodeDbAttributesGetter.java | 6 - .../hibernate/v3_3/AbstractHibernateTest.java | 4 - .../hibernate/v4_0/CriteriaTest.java | 1 - .../hibernate/v4_0/EntityManagerTest.java | 8 - .../hibernate/v4_0/QueryTest.java | 6 - .../hibernate/v4_0/SessionTest.java | 15 -- .../test/java/spring/jpa/SpringJpaTest.java | 12 - .../hibernate/v6_0/CriteriaTest.java | 2 - .../hibernate/v6_0/EntityManagerTest.java | 6 - .../hibernate/v6_0/ProcedureCallTest.java | 2 - .../hibernate/v6_0/SessionTest.java | 6 - .../src/test/groovy/SpringJpaTest.groovy | 11 - .../hibernate/v4_3/ProcedureCallTest.java | 2 - .../groovy/JdbcInstrumentationTest.groovy | 14 - .../scalaexecutors/SlickTest.scala | 4 - .../DataSourceDbAttributesExtractor.java | 2 - .../jdbc/internal/JdbcAttributesGetter.java | 6 - .../internal/JdbcConnectionUrlParser.java | 27 +- .../jdbc/internal/dbinfo/DbInfo.java | 7 - .../jdbc/OpenTelemetryConnectionTest.groovy | 7 - .../JdbcConnectionUrlParserTest.groovy | 255 +++++++++--------- .../OpenTelemetryDataSourceTest.java | 7 +- .../jedis/v1_4/JedisDbAttributesGetter.java | 5 - .../jedis/v3_0/JedisDbAttributesGetter.java | 5 - .../jedis/v4_0/JedisDbAttributesGetter.java | 5 - .../v4_0/LettuceDbAttributesGetter.java | 6 - .../v5_0/LettuceDbAttributesGetter.java | 6 - .../mongo/v3_1/MongoDbAttributesGetter.java | 20 -- .../testing/AbstractMongoClientTest.groovy | 2 - .../rest/OpenSearchRestAttributesGetter.java | 6 - .../r2dbc/v1_0/internal/DbExecution.java | 20 -- .../internal/R2dbcSqlAttributesGetter.java | 6 - .../r2dbc/v1_0/DbExecutionTest.java | 1 - .../v1_0/AbstractR2dbcStatementTest.java | 5 - .../rediscala/RediscalaAttributesGetter.java | 6 - .../redisson/RedissonDbAttributesGetter.java | 5 - .../data/v3_0/ReactiveSpringDataTest.java | 3 - .../src/main/java/AbstractSpringJpaTest.java | 16 -- .../SpymemcachedAttributesGetter.java | 6 - .../VertxRedisClientAttributesGetter.java | 6 - .../v4_0/redis/VertxRedisClientRequest.java | 4 - .../VertxReactivePropagationTest.groovy | 4 - .../VertxReactivePropagationTest.groovy | 3 - .../sql/VertxSqlClientAttributesGetter.java | 6 - 54 files changed, 135 insertions(+), 484 deletions(-) diff --git a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesExtractor.java b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesExtractor.java index a0055b714901..96b9225ce01c 100644 --- a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesExtractor.java +++ b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesExtractor.java @@ -25,16 +25,11 @@ abstract class DbClientCommonAttributesExtractor< this.getter = getter; } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Override public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) { internalSet(attributes, DbIncubatingAttributes.DB_SYSTEM, getter.getSystem(request)); internalSet(attributes, DbIncubatingAttributes.DB_USER, getter.getUser(request)); internalSet(attributes, DbIncubatingAttributes.DB_NAME, getter.getName(request)); - internalSet( - attributes, - DbIncubatingAttributes.DB_CONNECTION_STRING, - getter.getConnectionString(request)); } @Override diff --git a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java index 430be029cb0c..feaf91d2f68f 100644 --- a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java +++ b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java @@ -19,6 +19,10 @@ public interface DbClientCommonAttributesGetter { @Nullable String getName(REQUEST request); + // to be removed in the next release, use `server.address` and `server.port` instead @Nullable - String getConnectionString(REQUEST request); + @Deprecated + default String getConnectionString(REQUEST request) { + return null; + } } diff --git a/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java b/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java index 68991d1b813a..bbab0332ed3d 100644 --- a/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java +++ b/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java @@ -36,11 +36,6 @@ public String getName(Map map) { return map.get("db.name"); } - @Override - public String getConnectionString(Map map) { - return map.get("db.connection_string"); - } - @Override public String getStatement(Map map) { return map.get("db.statement"); @@ -52,7 +47,6 @@ public String getOperation(Map map) { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void shouldExtractAllAvailableAttributes() { // given @@ -60,7 +54,6 @@ void shouldExtractAllAvailableAttributes() { request.put("db.system", "myDb"); request.put("db.user", "username"); request.put("db.name", "potatoes"); - request.put("db.connection_string", "mydb:///potatoes"); request.put("db.statement", "SELECT * FROM potato"); request.put("db.operation", "SELECT"); @@ -82,7 +75,6 @@ void shouldExtractAllAvailableAttributes() { entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"), entry(DbIncubatingAttributes.DB_USER, "username"), entry(DbIncubatingAttributes.DB_NAME, "potatoes"), - entry(DbIncubatingAttributes.DB_CONNECTION_STRING, "mydb:///potatoes"), entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato"), entry(DbIncubatingAttributes.DB_OPERATION, "SELECT")); diff --git a/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java b/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java index f782a20b16ff..2bb92f5573a6 100644 --- a/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java +++ b/instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java @@ -42,14 +42,8 @@ public String getUser(Map map) { public String getName(Map map) { return map.get("db.name"); } - - @Override - public String getConnectionString(Map map) { - return map.get("db.connection_string"); - } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void shouldExtractAllAttributes() { // given @@ -57,7 +51,6 @@ void shouldExtractAllAttributes() { request.put("db.system", "myDb"); request.put("db.user", "username"); request.put("db.name", "potatoes"); - request.put("db.connection_string", "mydb:///potatoes"); request.put("db.statement", "SELECT * FROM potato WHERE id=12345"); Context context = Context.root(); @@ -78,7 +71,6 @@ void shouldExtractAllAttributes() { entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"), entry(DbIncubatingAttributes.DB_USER, "username"), entry(DbIncubatingAttributes.DB_NAME, "potatoes"), - entry(DbIncubatingAttributes.DB_CONNECTION_STRING, "mydb:///potatoes"), entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato WHERE id=?"), entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"), entry(DbIncubatingAttributes.DB_SQL_TABLE, "potato")); diff --git a/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSqlAttributesGetter.java b/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSqlAttributesGetter.java index 5b973f4e9922..dcaf5c4df574 100644 --- a/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSqlAttributesGetter.java +++ b/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSqlAttributesGetter.java @@ -28,12 +28,6 @@ public String getName(CassandraRequest request) { return request.getSession().getLoggedKeyspace(); } - @Override - @Nullable - public String getConnectionString(CassandraRequest request) { - return null; - } - @Override @Nullable public String getRawStatement(CassandraRequest request) { diff --git a/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSqlAttributesGetter.java b/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSqlAttributesGetter.java index e08cf36a940f..6de67a0d99c9 100644 --- a/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSqlAttributesGetter.java +++ b/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSqlAttributesGetter.java @@ -29,12 +29,6 @@ public String getName(CassandraRequest request) { return request.getSession().getKeyspace().map(CqlIdentifier::toString).orElse(null); } - @Override - @Nullable - public String getConnectionString(CassandraRequest request) { - return null; - } - @Override @Nullable public String getRawStatement(CassandraRequest request) { diff --git a/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraSqlAttributesGetter.java b/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraSqlAttributesGetter.java index c2dc9a0e2f67..dfd69eb2d99b 100644 --- a/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraSqlAttributesGetter.java +++ b/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraSqlAttributesGetter.java @@ -29,12 +29,6 @@ public String getName(CassandraRequest request) { return request.getSession().getKeyspace().map(CqlIdentifier::toString).orElse(null); } - @Override - @Nullable - public String getConnectionString(CassandraRequest request) { - return null; - } - @Override @Nullable public String getRawStatement(CassandraRequest request) { diff --git a/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseAttributesGetter.java b/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseAttributesGetter.java index 05edc5679f75..fe44ef9d873e 100644 --- a/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseAttributesGetter.java +++ b/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseAttributesGetter.java @@ -28,12 +28,6 @@ public String getName(CouchbaseRequestInfo couchbaseRequest) { return couchbaseRequest.bucket(); } - @Override - @Nullable - public String getConnectionString(CouchbaseRequestInfo couchbaseRequest) { - return null; - } - @Override @Nullable public String getStatement(CouchbaseRequestInfo couchbaseRequest) { diff --git a/instrumentation/elasticsearch/elasticsearch-rest-common/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/internal/ElasticsearchDbAttributesGetter.java b/instrumentation/elasticsearch/elasticsearch-rest-common/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/internal/ElasticsearchDbAttributesGetter.java index aaf65a7e44b1..9872932aa3a1 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-common/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/internal/ElasticsearchDbAttributesGetter.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-common/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/internal/ElasticsearchDbAttributesGetter.java @@ -51,12 +51,6 @@ public String getName(ElasticsearchRestRequest request) { return null; } - @Override - @Nullable - public String getConnectionString(ElasticsearchRestRequest request) { - return null; - } - @Override @Nullable public String getStatement(ElasticsearchRestRequest request) { diff --git a/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportAttributesGetter.java b/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportAttributesGetter.java index 537dd06bed20..40ce88b940c7 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportAttributesGetter.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportAttributesGetter.java @@ -29,12 +29,6 @@ public String getName(ElasticTransportRequest s) { return null; } - @Override - @Nullable - public String getConnectionString(ElasticTransportRequest s) { - return null; - } - @Override @Nullable public String getStatement(ElasticTransportRequest s) { diff --git a/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeDbAttributesGetter.java b/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeDbAttributesGetter.java index e4382e20413f..4d45708ca56e 100644 --- a/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeDbAttributesGetter.java +++ b/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeDbAttributesGetter.java @@ -32,12 +32,6 @@ public String getName(GeodeRequest request) { return request.getRegion().getName(); } - @Override - @Nullable - public String getConnectionString(GeodeRequest request) { - return null; - } - @Override @Nullable public String getStatement(GeodeRequest request) { diff --git a/instrumentation/hibernate/hibernate-3.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v3_3/AbstractHibernateTest.java b/instrumentation/hibernate/hibernate-3.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v3_3/AbstractHibernateTest.java index 7042194917d5..89906def789f 100644 --- a/instrumentation/hibernate/hibernate-3.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v3_3/AbstractHibernateTest.java +++ b/instrumentation/hibernate/hibernate-3.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v3_3/AbstractHibernateTest.java @@ -57,7 +57,6 @@ static void cleanUp() { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData parent) { return span.hasKind(SpanKind.CLIENT) .hasParent(parent) @@ -65,13 +64,11 @@ static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData parent) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies(DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), satisfies(DbIncubatingAttributes.DB_OPERATION, val -> val.isInstanceOf(String.class)), equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "Value")); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData parent, String verb) { return span.hasName(verb.concat(" db1.Value")) .hasKind(SpanKind.CLIENT) @@ -80,7 +77,6 @@ static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData parent, Str equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith(verb.toLowerCase(Locale.ROOT))), diff --git a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/CriteriaTest.java b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/CriteriaTest.java index 509173d79e80..8c4bdf165f4a 100644 --- a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/CriteriaTest.java +++ b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/CriteriaTest.java @@ -69,7 +69,6 @@ void testCriteria(String methodName, Consumer interaction) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith("select")), diff --git a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/EntityManagerTest.java b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/EntityManagerTest.java index d9402fc439ca..fe670d24d4f5 100644 --- a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/EntityManagerTest.java +++ b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/EntityManagerTest.java @@ -34,7 +34,6 @@ class EntityManagerTest extends AbstractHibernateTest { static final EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("test-pu"); - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsHibernateActionParameters") void testHibernateActions(Parameter parameter) { @@ -103,7 +102,6 @@ void testHibernateActions(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -134,7 +132,6 @@ void testHibernateActions(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -184,7 +181,6 @@ private static Stream provideArgumentsHibernateActionParameters() { Arguments.of(named("remove", new Parameter("delete", true, true, EntityManager::remove)))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testHibernatePersist() { EntityManager entityManager = entityManagerFactory.createEntityManager(); @@ -220,7 +216,6 @@ void testHibernatePersist() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -246,7 +241,6 @@ void testHibernatePersist() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -256,7 +250,6 @@ void testHibernatePersist() { equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "Value")))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsAttachesState") void testAttachesStateToQuery(Function queryBuildMethod) { @@ -295,7 +288,6 @@ void testAttachesStateToQuery(Function queryBuildMethod) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), diff --git a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/QueryTest.java b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/QueryTest.java index f68fe97e9ba5..0b240fa866f3 100644 --- a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/QueryTest.java +++ b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/QueryTest.java @@ -25,7 +25,6 @@ class QueryTest extends AbstractHibernateTest { - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testHibernateQueryExecuteUpdateWithTransaction() { testing.runWithSpan( @@ -64,7 +63,6 @@ void testHibernateQueryExecuteUpdateWithTransaction() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -85,7 +83,6 @@ void testHibernateQueryExecuteUpdateWithTransaction() { .get(stringKey("hibernate.session_id")))))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("providesArgumentsSingleCall") void testHibernateQuerySingleCall(Parameter parameter) { @@ -122,7 +119,6 @@ void testHibernateQuerySingleCall(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), @@ -155,7 +151,6 @@ private static Stream providesArgumentsSingleCall() { new Parameter("SELECT Value", sess -> sess.createQuery("from Value").scroll())))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testHibernateQueryIterate() { testing.runWithSpan( @@ -196,7 +191,6 @@ void testHibernateQueryIterate() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), diff --git a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/SessionTest.java b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/SessionTest.java index b40068f4827f..97843c7c0ec6 100644 --- a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/SessionTest.java +++ b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_0/SessionTest.java @@ -34,7 +34,6 @@ @SuppressWarnings("deprecation") // 'lock' is a deprecated method in the Session class class SessionTest extends AbstractHibernateTest { - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsHibernateAction") void testHibernateAction(Parameter parameter) { @@ -67,7 +66,6 @@ void testHibernateAction(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -144,7 +142,6 @@ private static Stream provideArgumentsHibernateAction() { null)))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsHibernateActionStateless") void testHibernateActionStateless(Parameter parameter) { @@ -178,7 +175,6 @@ void testHibernateActionStateless(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -292,7 +288,6 @@ private static Stream provideArgumentsHibernateActionStateless() { })))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsHibernateReplicate") void testHibernateReplicate(Parameter parameter) { @@ -325,7 +320,6 @@ void testHibernateReplicate(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -351,7 +345,6 @@ void testHibernateReplicate(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -440,7 +433,6 @@ void testHibernateFailedReplicate() { .get(stringKey("hibernate.session_id")))))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsHibernateCommitAction") void testHibernateCommitAction(Parameter parameter) { @@ -485,7 +477,6 @@ void testHibernateCommitAction(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -630,7 +621,6 @@ private static Stream provideArgumentsHibernateCommitAction() { null)))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @MethodSource("provideArgumentsStateQuery") void testAttachesStateToQueryCreated(Consumer queryBuilder) { @@ -664,7 +654,6 @@ void testAttachesStateToQueryCreated(Consumer queryBuilder) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -703,7 +692,6 @@ private static Stream provideArgumentsStateQuery() { session -> session.createSQLQuery("SELECT * FROM Value").list()))))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testHibernateOverlappingSessions() { testing.runWithSpan( @@ -765,7 +753,6 @@ void testHibernateOverlappingSessions() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith("insert")), @@ -809,7 +796,6 @@ void testHibernateOverlappingSessions() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith("insert")), @@ -823,7 +809,6 @@ void testHibernateOverlappingSessions() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith("delete")), diff --git a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/spring/jpa/SpringJpaTest.java b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/spring/jpa/SpringJpaTest.java index 17ebc73ba798..d2ab48f3dbcd 100644 --- a/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/spring/jpa/SpringJpaTest.java +++ b/instrumentation/hibernate/hibernate-4.0/javaagent/src/test/java/spring/jpa/SpringJpaTest.java @@ -31,7 +31,6 @@ class SpringJpaTest { new AnnotationConfigApplicationContext(PersistenceConfig.class); CustomerRepository repo = context.getBean(CustomerRepository.class); - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testCrud() { String version = Version.getVersionString(); @@ -69,7 +68,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -124,7 +122,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -170,7 +167,6 @@ void testCrud() { equalTo( DbIncubatingAttributes.DB_STATEMENT, "call next value for hibernate_sequence"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), equalTo(DbIncubatingAttributes.DB_OPERATION, "CALL")), span -> span.hasName("Transaction.commit") @@ -191,7 +187,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -238,7 +233,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -266,7 +260,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), equalTo( DbIncubatingAttributes.DB_STATEMENT, "update Customer set firstName=?, lastName=? where id=?"), @@ -304,7 +297,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -342,7 +334,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -374,7 +365,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), equalTo( DbIncubatingAttributes.DB_STATEMENT, "delete from Customer where id=?"), @@ -407,7 +397,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> @@ -447,7 +436,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), equalTo( DbIncubatingAttributes.DB_STATEMENT, "delete from Customer where id=?"), diff --git a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/CriteriaTest.java b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/CriteriaTest.java index d2ab1450ed09..3a9697e5bd03 100644 --- a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/CriteriaTest.java +++ b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/CriteriaTest.java @@ -36,7 +36,6 @@ private static Stream provideParameters() { Arguments.of(named("getSingleResultOrNull", interactions.get(2)))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest(name = "{index}: {0}") @MethodSource("provideParameters") void testCriteriaQuery(Consumer> interaction) { @@ -79,7 +78,6 @@ void testCriteriaQuery(Consumer> interaction) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith("select")), diff --git a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/EntityManagerTest.java b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/EntityManagerTest.java index 5bc237dc24b2..f1e46807411f 100644 --- a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/EntityManagerTest.java +++ b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/EntityManagerTest.java @@ -112,7 +112,6 @@ void testHibernateAction(Parameter parameter) { }); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest(name = "{index}: {0}") @MethodSource("provideAttachesStateParameters") void testAttachesStateToQuery(Parameter parameter) { @@ -141,7 +140,6 @@ void testAttachesStateToQuery(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -288,7 +286,6 @@ private static class Parameter { public final Function queryBuildMethod; } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation private static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData parent) { return span.hasKind(SpanKind.CLIENT) .hasParent(parent) @@ -296,13 +293,11 @@ private static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData par equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies(DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), satisfies(DbIncubatingAttributes.DB_OPERATION, val -> val.isInstanceOf(String.class)), equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "Value")); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation private static SpanDataAssert assertClientSpan( SpanDataAssert span, SpanData parent, String spanName) { return span.hasName(spanName) @@ -312,7 +307,6 @@ private static SpanDataAssert assertClientSpan( equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies(DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), satisfies(DbIncubatingAttributes.DB_OPERATION, val -> val.isInstanceOf(String.class)), equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "Value")); diff --git a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/ProcedureCallTest.java b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/ProcedureCallTest.java index 1a1e36cf9a61..f7181cc1a9a2 100644 --- a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/ProcedureCallTest.java +++ b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/ProcedureCallTest.java @@ -69,7 +69,6 @@ static void cleanup() { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testProcedureCall() { testing.runWithSpan( @@ -105,7 +104,6 @@ void testProcedureCall() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), equalTo(DbIncubatingAttributes.DB_STATEMENT, "{call TEST_PROC()}"), equalTo(DbIncubatingAttributes.DB_OPERATION, "CALL")), span -> diff --git a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/SessionTest.java b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/SessionTest.java index d95c4fe7805d..79a02d523cde 100644 --- a/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/SessionTest.java +++ b/instrumentation/hibernate/hibernate-6.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v6_0/SessionTest.java @@ -219,7 +219,6 @@ void testHibernateCommitAction(Parameter parameter) { span -> assertClientSpan(span, trace.getSpan(2)))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest(name = "{index}: {0}") @MethodSource("provideAttachesStateToQueryParameters") void testAttachesStateToQuery(Parameter parameter) { @@ -246,7 +245,6 @@ void testAttachesStateToQuery(Parameter parameter) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), @@ -803,7 +801,6 @@ private static SpanDataAssert assertSpanWithSessionId( equalTo(AttributeKey.stringKey("hibernate.session_id"), sessionId)); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation private static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData parent) { return span.hasKind(SpanKind.CLIENT) .hasParent(parent) @@ -811,13 +808,11 @@ private static SpanDataAssert assertClientSpan(SpanDataAssert span, SpanData par equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies(DbIncubatingAttributes.DB_STATEMENT, val -> val.isInstanceOf(String.class)), satisfies(DbIncubatingAttributes.DB_OPERATION, val -> val.isInstanceOf(String.class)), equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "Value")); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation private static SpanDataAssert assertClientSpan( SpanDataAssert span, SpanData parent, String verb) { return span.hasName(verb.concat(" db1.Value")) @@ -827,7 +822,6 @@ private static SpanDataAssert assertClientSpan( equalTo(DbIncubatingAttributes.DB_SYSTEM, "h2"), equalTo(DbIncubatingAttributes.DB_NAME, "db1"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "h2:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, stringAssert -> stringAssert.startsWith(verb.toLowerCase(Locale.ROOT))), diff --git a/instrumentation/hibernate/hibernate-6.0/spring-testing/src/test/groovy/SpringJpaTest.groovy b/instrumentation/hibernate/hibernate-6.0/spring-testing/src/test/groovy/SpringJpaTest.groovy index 6be2e3e5cdb7..6cdae51422a1 100644 --- a/instrumentation/hibernate/hibernate-6.0/spring-testing/src/test/groovy/SpringJpaTest.groovy +++ b/instrumentation/hibernate/hibernate-6.0/spring-testing/src/test/groovy/SpringJpaTest.groovy @@ -23,7 +23,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { @Shared def repo = context.getBean(CustomerRepository) - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "test CRUD"() { setup: def isHibernate4 = Version.getVersionString().startsWith("4.") @@ -64,7 +63,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/select ([^.]+)\.id([^,]*),([^.]+)\.firstName([^,]*),([^.]+)\.lastName(.*)from Customer(.*)/ "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -121,7 +119,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" "$DbIncubatingAttributes.DB_STATEMENT" "call next value for Customer_SEQ" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_OPERATION" "CALL" } } @@ -141,7 +138,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/insert into Customer \(.*\) values \(.*\)/ "$DbIncubatingAttributes.DB_OPERATION" "INSERT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -156,7 +152,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/insert into Customer \(.*\) values \(.*\)/ "$DbIncubatingAttributes.DB_OPERATION" "INSERT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -211,7 +206,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/select ([^.]+)\.id([^,]*),([^.]+)\.firstName([^,]*),([^.]+)\.lastName (.*)from Customer (.*)where ([^.]+)\.id( ?)=( ?)\?/ "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -232,7 +226,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/update Customer set firstName=\?,(.*)lastName=\? where id=\?/ "$DbIncubatingAttributes.DB_OPERATION" "UPDATE" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -275,7 +268,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/select ([^.]+)\.id([^,]*),([^.]+)\.firstName([^,]*),([^.]+)\.lastName (.*)from Customer (.*)(where ([^.]+)\.lastName( ?)=( ?)\?|)/ "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -319,7 +311,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/select ([^.]+)\.id([^,]*),([^.]+)\.firstName([^,]*),([^.]+)\.lastName (.*)from Customer (.*)where ([^.]+)\.id( ?)=( ?)\?/ "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -344,7 +335,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" ~/select ([^.]+)\.id([^,]*),([^.]+)\.firstName([^,]*),([^.]+)\.lastName (.*)from Customer (.*)where ([^.]+)\.id( ?)=( ?)\?/ "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" @@ -374,7 +364,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "sa" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" "delete from Customer where id=?" "$DbIncubatingAttributes.DB_OPERATION" "DELETE" "$DbIncubatingAttributes.DB_SQL_TABLE" "Customer" diff --git a/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_3/ProcedureCallTest.java b/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_3/ProcedureCallTest.java index 3e36101c7bef..a0e74306dcbe 100644 --- a/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_3/ProcedureCallTest.java +++ b/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/hibernate/v4_3/ProcedureCallTest.java @@ -76,7 +76,6 @@ static void cleanUp() { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testProcedureCall() { @@ -118,7 +117,6 @@ void testProcedureCall() { equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), equalTo(DbIncubatingAttributes.DB_STATEMENT, "{call TEST_PROC()}"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), equalTo(DbIncubatingAttributes.DB_OPERATION, "CALL")), span -> span.hasName("Transaction.commit") diff --git a/instrumentation/jdbc/javaagent/src/test/groovy/JdbcInstrumentationTest.groovy b/instrumentation/jdbc/javaagent/src/test/groovy/JdbcInstrumentationTest.groovy index 39eec0059569..6fff2d60a202 100644 --- a/instrumentation/jdbc/javaagent/src/test/groovy/JdbcInstrumentationTest.groovy +++ b/instrumentation/jdbc/javaagent/src/test/groovy/JdbcInstrumentationTest.groovy @@ -167,7 +167,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "basic statement with #connection.getClass().getCanonicalName() on #system generates spans"() { setup: Statement statement = connection.createStatement() @@ -195,7 +194,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { if (username != null) { "$DbIncubatingAttributes.DB_USER" username } - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_STATEMENT" sanitizedQuery "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" table @@ -255,7 +253,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { if (username != null) { "$DbIncubatingAttributes.DB_USER" username } - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_STATEMENT" sanitizedQuery "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" table @@ -307,7 +304,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { if (username != null) { "$DbIncubatingAttributes.DB_USER" username } - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_STATEMENT" sanitizedQuery "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" table @@ -359,7 +355,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { if (username != null) { "$DbIncubatingAttributes.DB_USER" username } - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_STATEMENT" sanitizedQuery "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" table @@ -412,7 +407,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_USER" username } "$DbIncubatingAttributes.DB_STATEMENT" query - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_OPERATION" "CREATE TABLE" "$DbIncubatingAttributes.DB_SQL_TABLE" table } @@ -467,7 +461,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_USER" username } "$DbIncubatingAttributes.DB_STATEMENT" query - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_OPERATION" "CREATE TABLE" "$DbIncubatingAttributes.DB_SQL_TABLE" table } @@ -533,7 +526,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { if (username != null) { "$DbIncubatingAttributes.DB_USER" username } - "$DbIncubatingAttributes.DB_CONNECTION_STRING" url "$DbIncubatingAttributes.DB_STATEMENT" sanitizedQuery "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" table @@ -590,7 +582,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" system "$DbIncubatingAttributes.DB_USER" { user == null | user == it } "$DbIncubatingAttributes.DB_NAME" "jdbcunittest" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" connectionString } } if (recursive) { @@ -604,7 +595,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" system "$DbIncubatingAttributes.DB_USER" { user == null | user == it } "$DbIncubatingAttributes.DB_NAME" "jdbcunittest" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" connectionString } } } @@ -653,7 +643,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { attributes { "$DbIncubatingAttributes.DB_SYSTEM" "other_sql" "$DbIncubatingAttributes.DB_STATEMENT" "testing ?" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "testdb://localhost" "$ServerAttributes.SERVER_ADDRESS" "localhost" } } @@ -694,7 +683,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { attributes { "$DbIncubatingAttributes.DB_SYSTEM" "other_sql" "$DbIncubatingAttributes.DB_NAME" databaseName - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "testdb://localhost" "$DbIncubatingAttributes.DB_STATEMENT" sanitizedQuery "$DbIncubatingAttributes.DB_OPERATION" operation "$DbIncubatingAttributes.DB_SQL_TABLE" table @@ -752,7 +740,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" dbNameLower "$DbIncubatingAttributes.DB_USER" "SA" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" "SELECT ? FROM INFORMATION_SCHEMA.SYSTEM_USERS" "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "INFORMATION_SCHEMA.SYSTEM_USERS" @@ -799,7 +786,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification { childOf span(0) attributes { "$DbIncubatingAttributes.DB_SYSTEM" "other_sql" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "testdb://localhost" "$DbIncubatingAttributes.DB_STATEMENT" "SELECT * FROM table" "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "table" diff --git a/instrumentation/jdbc/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/scalaexecutors/SlickTest.scala b/instrumentation/jdbc/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/scalaexecutors/SlickTest.scala index dc1ff375acc6..a8d4bff3cb38 100644 --- a/instrumentation/jdbc/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/scalaexecutors/SlickTest.scala +++ b/instrumentation/jdbc/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/scalaexecutors/SlickTest.scala @@ -85,10 +85,6 @@ class SlickTest { ), equalTo(DbIncubatingAttributes.DB_NAME, Db), equalTo(DbIncubatingAttributes.DB_USER, Username), - equalTo( - DbIncubatingAttributes.DB_CONNECTION_STRING, - "h2:mem:" - ), equalTo(DbIncubatingAttributes.DB_STATEMENT, "SELECT ?"), equalTo(DbIncubatingAttributes.DB_OPERATION, "SELECT") ) diff --git a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceDbAttributesExtractor.java b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceDbAttributesExtractor.java index e47d7dcddc30..72e818865b1d 100644 --- a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceDbAttributesExtractor.java +++ b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceDbAttributesExtractor.java @@ -21,7 +21,6 @@ enum DataSourceDbAttributesExtractor implements AttributesExtractor splitQuery(String query, String separator) { if (query == null || query.isEmpty()) { diff --git a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/dbinfo/DbInfo.java b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/dbinfo/DbInfo.java index cb758bdf7e8f..7654b590b7f3 100644 --- a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/dbinfo/DbInfo.java +++ b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/dbinfo/DbInfo.java @@ -27,10 +27,6 @@ public static DbInfo.Builder builder() { @Nullable public abstract String getSubtype(); - // "type:[subtype:]//host:port" - @Nullable - public abstract String getShortUrl(); - @Nullable public abstract String getUser(); @@ -50,7 +46,6 @@ public Builder toBuilder() { return builder() .system(getSystem()) .subtype(getSubtype()) - .shortUrl(getShortUrl()) .user(getUser()) .name(getName()) .db(getDb()) @@ -69,8 +64,6 @@ public abstract static class Builder { public abstract Builder subtype(String subtype); - public abstract Builder shortUrl(String shortUrl); - public abstract Builder user(String user); public abstract Builder name(String name); diff --git a/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/OpenTelemetryConnectionTest.groovy b/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/OpenTelemetryConnectionTest.groovy index da895c0c5f04..5f43a97e953a 100644 --- a/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/OpenTelemetryConnectionTest.groovy +++ b/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/OpenTelemetryConnectionTest.groovy @@ -24,7 +24,6 @@ import static io.opentelemetry.instrumentation.jdbc.internal.JdbcInstrumenterFac class OpenTelemetryConnectionTest extends InstrumentationSpecification implements LibraryTestTrait { - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "verify create statement"() { setup: def instr = createStatementInstrumenter(openTelemetry) @@ -52,7 +51,6 @@ class OpenTelemetryConnectionTest extends InstrumentationSpecification implement "$DbIncubatingAttributes.DB_SYSTEM" dbInfo.system "$DbIncubatingAttributes.DB_NAME" dbInfo.name "$DbIncubatingAttributes.DB_USER" dbInfo.user - "$DbIncubatingAttributes.DB_CONNECTION_STRING" dbInfo.shortUrl "$ServerAttributes.SERVER_ADDRESS" dbInfo.host "$ServerAttributes.SERVER_PORT" dbInfo.port "$DbIncubatingAttributes.DB_STATEMENT" query @@ -81,7 +79,6 @@ class OpenTelemetryConnectionTest extends InstrumentationSpecification implement connection.createStatement().instrumenter == instr } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "verify prepare statement"() { setup: def instr = createStatementInstrumenter(openTelemetry) @@ -109,7 +106,6 @@ class OpenTelemetryConnectionTest extends InstrumentationSpecification implement "$DbIncubatingAttributes.DB_SYSTEM" dbInfo.system "$DbIncubatingAttributes.DB_NAME" dbInfo.name "$DbIncubatingAttributes.DB_USER" dbInfo.user - "$DbIncubatingAttributes.DB_CONNECTION_STRING" dbInfo.shortUrl "$ServerAttributes.SERVER_ADDRESS" dbInfo.host "$ServerAttributes.SERVER_PORT" dbInfo.port "$DbIncubatingAttributes.DB_STATEMENT" query @@ -142,7 +138,6 @@ class OpenTelemetryConnectionTest extends InstrumentationSpecification implement connection.prepareStatement(query).instrumenter == instr } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "verify prepare call"() { setup: def instr = createStatementInstrumenter(openTelemetry) @@ -170,7 +165,6 @@ class OpenTelemetryConnectionTest extends InstrumentationSpecification implement "$DbIncubatingAttributes.DB_SYSTEM" dbInfo.system "$DbIncubatingAttributes.DB_NAME" dbInfo.name "$DbIncubatingAttributes.DB_USER" dbInfo.user - "$DbIncubatingAttributes.DB_CONNECTION_STRING" dbInfo.shortUrl "$ServerAttributes.SERVER_ADDRESS" dbInfo.host "$ServerAttributes.SERVER_PORT" dbInfo.port "$DbIncubatingAttributes.DB_STATEMENT" query @@ -204,7 +198,6 @@ class OpenTelemetryConnectionTest extends InstrumentationSpecification implement DbInfo.builder() .system("my_system") .subtype("my_sub_type") - .shortUrl("my_connection_string") .user("my_user") .name("my_name") .db("my_db") diff --git a/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/internal/JdbcConnectionUrlParserTest.groovy b/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/internal/JdbcConnectionUrlParserTest.groovy index 03c6ff9c457b..1fa71b8d2000 100644 --- a/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/internal/JdbcConnectionUrlParserTest.groovy +++ b/instrumentation/jdbc/library/src/test/groovy/io/opentelemetry/instrumentation/jdbc/internal/JdbcConnectionUrlParserTest.groovy @@ -47,7 +47,6 @@ class JdbcConnectionUrlParserTest extends Specification { def info = parse(url, props) expect: - info.shortUrl == expected.shortUrl info.system == expected.system info.host == expected.host info.port == expected.port @@ -58,174 +57,174 @@ class JdbcConnectionUrlParserTest extends Specification { info == expected where: - url | props | shortUrl | system | subtype | user | host | port | name | db + url | props | system | subtype | user | host | port | name | db // https://jdbc.postgresql.org/documentation/94/connect.html - "jdbc:postgresql:///" | null | "postgresql://localhost:5432" | "postgresql" | null | null | "localhost" | 5432 | null | null - "jdbc:postgresql:///" | stdProps | "postgresql://stdServerName:9999" | "postgresql" | null | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" - "jdbc:postgresql://pg.host" | null | "postgresql://pg.host:5432" | "postgresql" | null | null | "pg.host" | 5432 | null | null - "jdbc:postgresql://pg.host:11/pgdb?user=pguser&password=PW" | null | "postgresql://pg.host:11" | "postgresql" | null | "pguser" | "pg.host" | 11 | null | "pgdb" + "jdbc:postgresql:///" | null | "postgresql" | null | null | "localhost" | 5432 | null | null + "jdbc:postgresql:///" | stdProps | "postgresql" | null | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" + "jdbc:postgresql://pg.host" | null | "postgresql" | null | null | "pg.host" | 5432 | null | null + "jdbc:postgresql://pg.host:11/pgdb?user=pguser&password=PW" | null | "postgresql" | null | "pguser" | "pg.host" | 11 | null | "pgdb" - "jdbc:postgresql://pg.host:11/pgdb?user=pguser&password=PW" | stdProps | "postgresql://pg.host:11" | "postgresql" | null | "pguser" | "pg.host" | 11 | null | "pgdb" + "jdbc:postgresql://pg.host:11/pgdb?user=pguser&password=PW" | stdProps | "postgresql" | null | "pguser" | "pg.host" | 11 | null | "pgdb" // https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-jdbc-url-format.html // https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html - "jdbc:mysql:///" | null | "mysql://localhost:3306" | "mysql" | null | null | "localhost" | 3306 | null | null - "jdbc:mysql:///" | stdProps | "mysql://stdServerName:9999" | "mysql" | null | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" - "jdbc:mysql://my.host" | null | "mysql://my.host:3306" | "mysql" | null | null | "my.host" | 3306 | null | null - "jdbc:mysql://my.host?user=myuser&password=PW" | null | "mysql://my.host:3306" | "mysql" | null | "myuser" | "my.host" | 3306 | null | null - "jdbc:mysql://my.host:22/mydb?user=myuser&password=PW" | null | "mysql://my.host:22" | "mysql" | null | "myuser" | "my.host" | 22 | null | "mydb" - "jdbc:mysql://127.0.0.1:22/mydb?user=myuser&password=PW" | stdProps | "mysql://127.0.0.1:22" | "mysql" | null | "myuser" | "127.0.0.1" | 22 | null | "mydb" - "jdbc:mysql://myuser:password@my.host:22/mydb" | null | "mysql://my.host:22" | "mysql" | null | "myuser" | "my.host" | 22 | null | "mydb" + "jdbc:mysql:///" | null | "mysql" | null | null | "localhost" | 3306 | null | null + "jdbc:mysql:///" | stdProps | "mysql" | null | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" + "jdbc:mysql://my.host" | null | "mysql" | null | null | "my.host" | 3306 | null | null + "jdbc:mysql://my.host?user=myuser&password=PW" | null | "mysql" | null | "myuser" | "my.host" | 3306 | null | null + "jdbc:mysql://my.host:22/mydb?user=myuser&password=PW" | null | "mysql" | null | "myuser" | "my.host" | 22 | null | "mydb" + "jdbc:mysql://127.0.0.1:22/mydb?user=myuser&password=PW" | stdProps | "mysql" | null | "myuser" | "127.0.0.1" | 22 | null | "mydb" + "jdbc:mysql://myuser:password@my.host:22/mydb" | null | "mysql" | null | "myuser" | "my.host" | 22 | null | "mydb" // https://mariadb.com/kb/en/library/about-mariadb-connector-j/#connection-strings - "jdbc:mariadb:127.0.0.1:33/mdbdb" | null | "mariadb://127.0.0.1:33" | "mariadb" | null | null | "127.0.0.1" | 33 | null | "mdbdb" - "jdbc:mariadb:localhost/mdbdb" | null | "mariadb://localhost:3306" | "mariadb" | null | null | "localhost" | 3306 | null | "mdbdb" - "jdbc:mariadb:localhost/mdbdb?user=mdbuser&password=PW" | stdProps | "mariadb://localhost:9999" | "mariadb" | null | "mdbuser" | "localhost" | 9999 | null | "mdbdb" - "jdbc:mariadb:localhost:33/mdbdb" | stdProps | "mariadb://localhost:33" | "mariadb" | null | "stdUserName" | "localhost" | 33 | null | "mdbdb" - "jdbc:mariadb://mdb.host:33/mdbdb?user=mdbuser&password=PW" | null | "mariadb://mdb.host:33" | "mariadb" | null | "mdbuser" | "mdb.host" | 33 | null | "mdbdb" - "jdbc:mariadb:aurora://mdb.host/mdbdb" | null | "mariadb:aurora://mdb.host:3306" | "mariadb" | "aurora" | null | "mdb.host" | 3306 | null | "mdbdb" - "jdbc:mysql:aurora://mdb.host/mdbdb" | null | "mysql:aurora://mdb.host:3306" | "mysql" | "aurora" | null | "mdb.host" | 3306 | null | "mdbdb" - "jdbc:mysql:failover://localhost/mdbdb?autoReconnect=true" | null | "mysql:failover://localhost:3306" | "mysql" | "failover" | null | "localhost" | 3306 | null | "mdbdb" - "jdbc:mariadb:failover://mdb.host1:33,mdb.host/mdbdb?characterEncoding=utf8" | null | "mariadb:failover://mdb.host1:33" | "mariadb" | "failover" | null | "mdb.host1" | 33 | null | "mdbdb" - "jdbc:mariadb:sequential://mdb.host1,mdb.host2:33/mdbdb" | null | "mariadb:sequential://mdb.host1:3306" | "mariadb" | "sequential" | null | "mdb.host1" | 3306 | null | "mdbdb" - "jdbc:mariadb:loadbalance://127.0.0.1:33,mdb.host/mdbdb" | null | "mariadb:loadbalance://127.0.0.1:33" | "mariadb" | "loadbalance" | null | "127.0.0.1" | 33 | null | "mdbdb" - "jdbc:mariadb:loadbalance://127.0.0.1:33/mdbdb" | null | "mariadb:loadbalance://127.0.0.1:33" | "mariadb" | "loadbalance" | null | "127.0.0.1" | 33 | null | "mdbdb" - "jdbc:mariadb:loadbalance://[2001:0660:7401:0200:0000:0000:0edf:bdd7]:33,mdb.host/mdbdb" | null | "mariadb:loadbalance://2001:0660:7401:0200:0000:0000:0edf:bdd7:33" | "mariadb" | "loadbalance" | null | "2001:0660:7401:0200:0000:0000:0edf:bdd7" | 33 | null | "mdbdb" - "jdbc:mysql:loadbalance://127.0.0.1,127.0.0.1:3306/mdbdb?user=mdbuser&password=PW" | null | "mysql:loadbalance://127.0.0.1:3306" | "mysql" | "loadbalance" | "mdbuser" | "127.0.0.1" | 3306 | null | "mdbdb" - "jdbc:mariadb:replication://localhost:33,anotherhost:3306/mdbdb" | null | "mariadb:replication://localhost:33" | "mariadb" | "replication" | null | "localhost" | 33 | null | "mdbdb" + "jdbc:mariadb:127.0.0.1:33/mdbdb" | null | "mariadb" | null | null | "127.0.0.1" | 33 | null | "mdbdb" + "jdbc:mariadb:localhost/mdbdb" | null | "mariadb" | null | null | "localhost" | 3306 | null | "mdbdb" + "jdbc:mariadb:localhost/mdbdb?user=mdbuser&password=PW" | stdProps | "mariadb" | null | "mdbuser" | "localhost" | 9999 | null | "mdbdb" + "jdbc:mariadb:localhost:33/mdbdb" | stdProps | "mariadb" | null | "stdUserName" | "localhost" | 33 | null | "mdbdb" + "jdbc:mariadb://mdb.host:33/mdbdb?user=mdbuser&password=PW" | null | "mariadb" | null | "mdbuser" | "mdb.host" | 33 | null | "mdbdb" + "jdbc:mariadb:aurora://mdb.host/mdbdb" | null | "mariadb" | "aurora" | null | "mdb.host" | 3306 | null | "mdbdb" + "jdbc:mysql:aurora://mdb.host/mdbdb" | null | "mysql" | "aurora" | null | "mdb.host" | 3306 | null | "mdbdb" + "jdbc:mysql:failover://localhost/mdbdb?autoReconnect=true" | null | "mysql" | "failover" | null | "localhost" | 3306 | null | "mdbdb" + "jdbc:mariadb:failover://mdb.host1:33,mdb.host/mdbdb?characterEncoding=utf8" | null | "mariadb" | "failover" | null | "mdb.host1" | 33 | null | "mdbdb" + "jdbc:mariadb:sequential://mdb.host1,mdb.host2:33/mdbdb" | null | "mariadb" | "sequential" | null | "mdb.host1" | 3306 | null | "mdbdb" + "jdbc:mariadb:loadbalance://127.0.0.1:33,mdb.host/mdbdb" | null | "mariadb" | "loadbalance" | null | "127.0.0.1" | 33 | null | "mdbdb" + "jdbc:mariadb:loadbalance://127.0.0.1:33/mdbdb" | null | "mariadb" | "loadbalance" | null | "127.0.0.1" | 33 | null | "mdbdb" + "jdbc:mariadb:loadbalance://[2001:0660:7401:0200:0000:0000:0edf:bdd7]:33,mdb.host/mdbdb" | null | "mariadb" | "loadbalance" | null | "2001:0660:7401:0200:0000:0000:0edf:bdd7" | 33 | null | "mdbdb" + "jdbc:mysql:loadbalance://127.0.0.1,127.0.0.1:3306/mdbdb?user=mdbuser&password=PW" | null | "mysql" | "loadbalance" | "mdbuser" | "127.0.0.1" | 3306 | null | "mdbdb" + "jdbc:mariadb:replication://localhost:33,anotherhost:3306/mdbdb" | null | "mariadb" | "replication" | null | "localhost" | 33 | null | "mdbdb" "jdbc:mysql:replication://address=(HOST=127.0.0.1)(port=33)(user=mdbuser)(password=PW)," + - "address=(host=mdb.host)(port=3306)(user=otheruser)(password=PW)/mdbdb?user=wrong&password=PW" | null | "mysql:replication://127.0.0.1:33" | "mysql" | "replication" | "mdbuser" | "127.0.0.1" | 33 | null | "mdbdb" + "address=(host=mdb.host)(port=3306)(user=otheruser)(password=PW)/mdbdb?user=wrong&password=PW" | null | "mysql" | "replication" | "mdbuser" | "127.0.0.1" | 33 | null | "mdbdb" "jdbc:mysql:replication://address=(HOST=mdb.host)," + - "address=(host=anotherhost)(port=3306)(user=wrong)(password=PW)/mdbdb?user=mdbuser&password=PW" | null | "mysql:replication://mdb.host:3306" | "mysql" | "replication" | "mdbuser" | "mdb.host" | 3306 | null | "mdbdb" + "address=(host=anotherhost)(port=3306)(user=wrong)(password=PW)/mdbdb?user=mdbuser&password=PW" | null | "mysql" | "replication" | "mdbuser" | "mdb.host" | 3306 | null | "mdbdb" //https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url - "jdbc:microsoft:sqlserver://;" | null | "microsoft:sqlserver://localhost:1433" | "mssql" | "sqlserver" | null | "localhost" | 1433 | null | null - "jdbc:sqlserver://;serverName=3ffe:8311:eeee:f70f:0:5eae:10.203.31.9" | null | "sqlserver://[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]:1433" | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 1433 | null | null - "jdbc:sqlserver://;serverName=2001:0db8:85a3:0000:0000:8a2e:0370:7334" | null | "sqlserver://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:1433" | "mssql" | null | null | "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]" | 1433 | null | null - "jdbc:sqlserver://;serverName=[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]:43" | null | "sqlserver://[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]:43" | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 43 | null | null - "jdbc:sqlserver://;serverName=3ffe:8311:eeee:f70f:0:5eae:10.203.31.9\\ssinstance" | null | "sqlserver://[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]:1433" | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 1433 | "ssinstance" | null - "jdbc:sqlserver://;serverName=[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9\\ssinstance]:43" | null | "sqlserver://[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]:43" | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 43 | "ssinstance" | null - "jdbc:microsoft:sqlserver://;" | stdProps | "microsoft:sqlserver://stdServerName:9999" | "mssql" | "sqlserver" | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" - "jdbc:sqlserver://ss.host\\ssinstance:44;databaseName=ssdb;user=ssuser;password=pw" | null | "sqlserver://ss.host:44" | "mssql" | null | "ssuser" | "ss.host" | 44 | "ssinstance" | "ssdb" - "jdbc:sqlserver://;serverName=ss.host\\ssinstance:44;DatabaseName=;" | null | "sqlserver://ss.host:44" | "mssql" | null | null | "ss.host" | 44 | "ssinstance" | null - "jdbc:sqlserver://ss.host;serverName=althost;DatabaseName=ssdb;" | null | "sqlserver://ss.host:1433" | "mssql" | null | null | "ss.host" | 1433 | null | "ssdb" - "jdbc:microsoft:sqlserver://ss.host:44;DatabaseName=ssdb;user=ssuser;password=pw;user=ssuser2;" | null | "microsoft:sqlserver://ss.host:44" | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 44 | null | "ssdb" + "jdbc:microsoft:sqlserver://;" | null | "mssql" | "sqlserver" | null | "localhost" | 1433 | null | null + "jdbc:sqlserver://;serverName=3ffe:8311:eeee:f70f:0:5eae:10.203.31.9" | null | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 1433 | null | null + "jdbc:sqlserver://;serverName=2001:0db8:85a3:0000:0000:8a2e:0370:7334" | null | "mssql" | null | null | "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]" | 1433 | null | null + "jdbc:sqlserver://;serverName=[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]:43" | null | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 43 | null | null + "jdbc:sqlserver://;serverName=3ffe:8311:eeee:f70f:0:5eae:10.203.31.9\\ssinstance" | null | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 1433 | "ssinstance" | null + "jdbc:sqlserver://;serverName=[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9\\ssinstance]:43" | null | "mssql" | null | null | "[3ffe:8311:eeee:f70f:0:5eae:10.203.31.9]" | 43 | "ssinstance" | null + "jdbc:microsoft:sqlserver://;" | stdProps | "mssql" | "sqlserver" | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" + "jdbc:sqlserver://ss.host\\ssinstance:44;databaseName=ssdb;user=ssuser;password=pw" | null | "mssql" | null | "ssuser" | "ss.host" | 44 | "ssinstance" | "ssdb" + "jdbc:sqlserver://;serverName=ss.host\\ssinstance:44;DatabaseName=;" | null | "mssql" | null | null | "ss.host" | 44 | "ssinstance" | null + "jdbc:sqlserver://ss.host;serverName=althost;DatabaseName=ssdb;" | null | "mssql" | null | null | "ss.host" | 1433 | null | "ssdb" + "jdbc:microsoft:sqlserver://ss.host:44;DatabaseName=ssdb;user=ssuser;password=pw;user=ssuser2;" | null | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 44 | null | "ssdb" // http://jtds.sourceforge.net/faq.html#urlFormat - "jdbc:jtds:sqlserver://ss.host/ssdb" | null | "jtds:sqlserver://ss.host:1433" | "mssql" | "sqlserver" | null | "ss.host" | 1433 | null | "ssdb" - "jdbc:jtds:sqlserver://ss.host:1433/ssdb" | null | "jtds:sqlserver://ss.host:1433" | "mssql" | "sqlserver" | null | "ss.host" | 1433 | null | "ssdb" - "jdbc:jtds:sqlserver://ss.host:1433/ssdb;user=ssuser" | null | "jtds:sqlserver://ss.host:1433" | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 1433 | null | "ssdb" - "jdbc:jtds:sqlserver://ss.host:1433/ssdb;user=ssuser" | null | "jtds:sqlserver://ss.host:1433" | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 1433 | null | "ssdb" - "jdbc:jtds:sqlserver://ss.host/ssdb;instance=ssinstance" | null | "jtds:sqlserver://ss.host:1433" | "mssql" | "sqlserver" | null | "ss.host" | 1433 | "ssinstance" | "ssdb" - "jdbc:jtds:sqlserver://ss.host:1444/ssdb;instance=ssinstance" | null | "jtds:sqlserver://ss.host:1444" | "mssql" | "sqlserver" | null | "ss.host" | 1444 | "ssinstance" | "ssdb" - "jdbc:jtds:sqlserver://ss.host:1433/ssdb;instance=ssinstance;user=ssuser" | null | "jtds:sqlserver://ss.host:1433" | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 1433 | "ssinstance" | "ssdb" + "jdbc:jtds:sqlserver://ss.host/ssdb" | null | "mssql" | "sqlserver" | null | "ss.host" | 1433 | null | "ssdb" + "jdbc:jtds:sqlserver://ss.host:1433/ssdb" | null | "mssql" | "sqlserver" | null | "ss.host" | 1433 | null | "ssdb" + "jdbc:jtds:sqlserver://ss.host:1433/ssdb;user=ssuser" | null | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 1433 | null | "ssdb" + "jdbc:jtds:sqlserver://ss.host:1433/ssdb;user=ssuser" | null | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 1433 | null | "ssdb" + "jdbc:jtds:sqlserver://ss.host/ssdb;instance=ssinstance" | null | "mssql" | "sqlserver" | null | "ss.host" | 1433 | "ssinstance" | "ssdb" + "jdbc:jtds:sqlserver://ss.host:1444/ssdb;instance=ssinstance" | null | "mssql" | "sqlserver" | null | "ss.host" | 1444 | "ssinstance" | "ssdb" + "jdbc:jtds:sqlserver://ss.host:1433/ssdb;instance=ssinstance;user=ssuser" | null | "mssql" | "sqlserver" | "ssuser" | "ss.host" | 1433 | "ssinstance" | "ssdb" // https://docs.oracle.com/cd/B28359_01/java.111/b31224/urls.htm // https://docs.oracle.com/cd/B28359_01/java.111/b31224/jdbcthin.htm - "jdbc:oracle:thin:orcluser/PW@localhost:55:orclsn" | null | "oracle:thin://localhost:55" | "oracle" | "thin" | "orcluser" | "localhost" | 55 | "orclsn" | null - "jdbc:oracle:thin:orcluser/PW@//orcl.host:55/orclsn" | null | "oracle:thin://orcl.host:55" | "oracle" | "thin" | "orcluser" | "orcl.host" | 55 | "orclsn" | null - "jdbc:oracle:thin:orcluser/PW@127.0.0.1:orclsn" | null | "oracle:thin://127.0.0.1:1521" | "oracle" | "thin" | "orcluser" | "127.0.0.1" | 1521 | "orclsn" | null - "jdbc:oracle:thin:orcluser/PW@//orcl.host/orclsn" | null | "oracle:thin://orcl.host:1521" | "oracle" | "thin" | "orcluser" | "orcl.host" | 1521 | "orclsn" | null - "jdbc:oracle:thin:@//orcl.host:55/orclsn" | null | "oracle:thin://orcl.host:55" | "oracle" | "thin" | null | "orcl.host" | 55 | "orclsn" | null - "jdbc:oracle:thin:@ldap://orcl.host:55/some,cn=OracleContext,dc=com" | null | "oracle:thin://orcl.host:55" | "oracle" | "thin" | null | "orcl.host" | 55 | "some,cn=oraclecontext,dc=com" | null - "jdbc:oracle:thin:127.0.0.1:orclsn" | null | "oracle:thin://127.0.0.1:1521" | "oracle" | "thin" | null | "127.0.0.1" | 1521 | "orclsn" | null - "jdbc:oracle:thin:orcl.host:orclsn" | stdProps | "oracle:thin://orcl.host:9999" | "oracle" | "thin" | "stdUserName" | "orcl.host" | 9999 | "orclsn" | "stdDatabaseName" + "jdbc:oracle:thin:orcluser/PW@localhost:55:orclsn" | null | "oracle" | "thin" | "orcluser" | "localhost" | 55 | "orclsn" | null + "jdbc:oracle:thin:orcluser/PW@//orcl.host:55/orclsn" | null | "oracle" | "thin" | "orcluser" | "orcl.host" | 55 | "orclsn" | null + "jdbc:oracle:thin:orcluser/PW@127.0.0.1:orclsn" | null | "oracle" | "thin" | "orcluser" | "127.0.0.1" | 1521 | "orclsn" | null + "jdbc:oracle:thin:orcluser/PW@//orcl.host/orclsn" | null | "oracle" | "thin" | "orcluser" | "orcl.host" | 1521 | "orclsn" | null + "jdbc:oracle:thin:@//orcl.host:55/orclsn" | null | "oracle" | "thin" | null | "orcl.host" | 55 | "orclsn" | null + "jdbc:oracle:thin:@ldap://orcl.host:55/some,cn=OracleContext,dc=com" | null | "oracle" | "thin" | null | "orcl.host" | 55 | "some,cn=oraclecontext,dc=com" | null + "jdbc:oracle:thin:127.0.0.1:orclsn" | null | "oracle" | "thin" | null | "127.0.0.1" | 1521 | "orclsn" | null + "jdbc:oracle:thin:orcl.host:orclsn" | stdProps | "oracle" | "thin" | "stdUserName" | "orcl.host" | 9999 | "orclsn" | "stdDatabaseName" "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= 127.0.0.1 )(POR T= 666))" + - "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclsn)))" | null | "oracle:thin://127.0.0.1:1521" | "oracle" | "thin" | null | "127.0.0.1" | 1521 | "orclsn" | null + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclsn)))" | null | "oracle" | "thin" | null | "127.0.0.1" | 1521 | "orclsn" | null // https://docs.oracle.com/cd/B28359_01/java.111/b31224/instclnt.htm - "jdbc:oracle:drivertype:orcluser/PW@orcl.host:55/orclsn" | null | "oracle:drivertype://orcl.host:55" | "oracle" | "drivertype" | "orcluser" | "orcl.host" | 55 | "orclsn" | null - "jdbc:oracle:oci8:@" | null | "oracle:oci8:" | "oracle" | "oci8" | null | null | 1521 | null | null - "jdbc:oracle:oci8:@" | stdProps | "oracle:oci8://stdServerName:9999" | "oracle" | "oci8" | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" - "jdbc:oracle:oci8:@orclsn" | null | "oracle:oci8:" | "oracle" | "oci8" | null | null | 1521 | "orclsn" | null + "jdbc:oracle:drivertype:orcluser/PW@orcl.host:55/orclsn" | null | "oracle" | "drivertype" | "orcluser" | "orcl.host" | 55 | "orclsn" | null + "jdbc:oracle:oci8:@" | null | "oracle" | "oci8" | null | null | 1521 | null | null + "jdbc:oracle:oci8:@" | stdProps | "oracle" | "oci8" | "stdUserName" | "stdServerName" | 9999 | null | "stdDatabaseName" + "jdbc:oracle:oci8:@orclsn" | null | "oracle" | "oci8" | null | null | 1521 | "orclsn" | null "jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)( HOST = orcl.host )" + - "( PORT = 55 ))(CONNECT_DATA=(SERVICE_NAME =orclsn )))" | null | "oracle:oci://orcl.host:55" | "oracle" | "oci" | null | "orcl.host" | 55 | "orclsn" | null + "( PORT = 55 ))(CONNECT_DATA=(SERVICE_NAME =orclsn )))" | null | "oracle" | "oci" | null | "orcl.host" | 55 | "orclsn" | null // https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/java/src/tpc/imjcc_tjvjcccn.html - // https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.apdv.java.doc/src /tpc/imjcc_r0052342.html - "jdbc:db2://db2.host" | null | "db2://db2.host:50000" | "db2" | null | null | "db2.host" | 50000 | null | null - "jdbc:db2://db2.host" | stdProps | "db2://db2.host:9999" | "db2" | null | "stdUserName" | "db2.host" | 9999 | null | "stdDatabaseName" - "jdbc:db2://db2.host:77/db2db:user=db2user;password=PW;" | null | "db2://db2.host:77" | "db2" | null | "db2user" | "db2.host" | 77 | "db2db" | null - "jdbc:db2://db2.host:77/db2db:user=db2user;password=PW;" | stdProps | "db2://db2.host:77" | "db2" | null | "db2user" | "db2.host" | 77 | "db2db" | "stdDatabaseName" - "jdbc:as400://ashost:66/asdb:user=asuser;password=PW;" | null | "as400://ashost:66" | "db2" | null | "asuser" | "ashost" | 66 | "asdb" | null + // https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052342.html + "jdbc:db2://db2.host" | null | "db2" | null | null | "db2.host" | 50000 | null | null + "jdbc:db2://db2.host" | stdProps | "db2" | null | "stdUserName" | "db2.host" | 9999 | null | "stdDatabaseName" + "jdbc:db2://db2.host:77/db2db:user=db2user;password=PW;" | null | "db2" | null | "db2user" | "db2.host" | 77 | "db2db" | null + "jdbc:db2://db2.host:77/db2db:user=db2user;password=PW;" | stdProps | "db2" | null | "db2user" | "db2.host" | 77 | "db2db" | "stdDatabaseName" + "jdbc:as400://ashost:66/asdb:user=asuser;password=PW;" | null | "db2" | null | "asuser" | "ashost" | 66 | "asdb" | null // https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.03/en-US/ff15928cf5594d78b841fbbe649f04b4.html - "jdbc:sap://sap.host" | null | "sap://sap.host" | "hanadb" | null | null | "sap.host" | null | null | null - "jdbc:sap://sap.host" | stdProps | "sap://sap.host:9999" | "hanadb" | null | "stdUserName" | "sap.host" | 9999 | null | "stdDatabaseName" - "jdbc:sap://sap.host:88/?databaseName=sapdb&user=sapuser&password=PW" | null | "sap://sap.host:88" | "hanadb" | null | "sapuser" | "sap.host" | 88 | null | "sapdb" + "jdbc:sap://sap.host" | null | "hanadb" | null | null | "sap.host" | null | null | null + "jdbc:sap://sap.host" | stdProps | "hanadb" | null | "stdUserName" | "sap.host" | 9999 | null | "stdDatabaseName" + "jdbc:sap://sap.host:88/?databaseName=sapdb&user=sapuser&password=PW" | null | "hanadb" | null | "sapuser" | "sap.host" | 88 | null | "sapdb" // TODO: // "jdbc:informix-sqli://infxhost:99/infxdb:INFORMIXSERVER=infxsn;user=infxuser;password=PW" | null | "informix-sqli" | null | "infxuser" | "infxhost" | 99 | "infxdb"| null // "jdbc:informix-direct://infxdb:999;user=infxuser;password=PW" | null | "informix-direct" | null | "infxuser" | "infxhost" | 999 | "infxdb"| null // http://www.h2database.com/html/features.html#database_url - "jdbc:h2:mem:" | null | "h2:mem:" | "h2" | "mem" | null | null | null | null | null - "jdbc:h2:mem:" | stdProps | "h2:mem:" | "h2" | "mem" | "stdUserName" | null | null | null | "stdDatabaseName" - "jdbc:h2:mem:h2db" | null | "h2:mem:" | "h2" | "mem" | null | null | null | "h2db" | null - "jdbc:h2:tcp://h2.host:111/path/h2db;user=h2user;password=PW" | null | "h2:tcp://h2.host:111" | "h2" | "tcp" | "h2user" | "h2.host" | 111 | "path/h2db" | null - "jdbc:h2:ssl://h2.host:111/path/h2db;user=h2user;password=PW" | null | "h2:ssl://h2.host:111" | "h2" | "ssl" | "h2user" | "h2.host" | 111 | "path/h2db" | null - "jdbc:h2:/data/h2file" | null | "h2:file:" | "h2" | "file" | null | null | null | "/data/h2file" | null - "jdbc:h2:file:~/h2file;USER=h2user;PASSWORD=PW" | null | "h2:file:" | "h2" | "file" | null | null | null | "~/h2file" | null - "jdbc:h2:file:/data/h2file" | null | "h2:file:" | "h2" | "file" | null | null | null | "/data/h2file" | null - "jdbc:h2:file:C:/data/h2file" | null | "h2:file:" | "h2" | "file" | null | null | null | "c:/data/h2file" | null - "jdbc:h2:zip:~/db.zip!/h2zip" | null | "h2:zip:" | "h2" | "zip" | null | null | null | "~/db.zip!/h2zip" | null + "jdbc:h2:mem:" | null | "h2" | "mem" | null | null | null | null | null + "jdbc:h2:mem:" | stdProps | "h2" | "mem" | "stdUserName" | null | null | null | "stdDatabaseName" + "jdbc:h2:mem:h2db" | null | "h2" | "mem" | null | null | null | "h2db" | null + "jdbc:h2:tcp://h2.host:111/path/h2db;user=h2user;password=PW" | null | "h2" | "tcp" | "h2user" | "h2.host" | 111 | "path/h2db" | null + "jdbc:h2:ssl://h2.host:111/path/h2db;user=h2user;password=PW" | null | "h2" | "ssl" | "h2user" | "h2.host" | 111 | "path/h2db" | null + "jdbc:h2:/data/h2file" | null | "h2" | "file" | null | null | null | "/data/h2file" | null + "jdbc:h2:file:~/h2file;USER=h2user;PASSWORD=PW" | null | "h2" | "file" | null | null | null | "~/h2file" | null + "jdbc:h2:file:/data/h2file" | null | "h2" | "file" | null | null | null | "/data/h2file" | null + "jdbc:h2:file:C:/data/h2file" | null | "h2" | "file" | null | null | null | "c:/data/h2file" | null + "jdbc:h2:zip:~/db.zip!/h2zip" | null | "h2" | "zip" | null | null | null | "~/db.zip!/h2zip" | null // http://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html - "jdbc:hsqldb:hsdb" | null | "hsqldb:mem:" | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:hsdb" | stdProps | "hsqldb:mem:" | "hsqldb" | "mem" | "stdUserName" | null | null | "hsdb" | "stdDatabaseName" - "jdbc:hsqldb:mem:hsdb" | null | "hsqldb:mem:" | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:mem:hsdb;shutdown=true" | null | "hsqldb:mem:" | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:mem:hsdb?shutdown=true" | null | "hsqldb:mem:" | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:file:hsdb" | null | "hsqldb:file:" | "hsqldb" | "file" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:file:hsdb;user=aUserName;password=3xLVz" | null | "hsqldb:file:" | "hsqldb" | "file" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:file:hsdb;create=false?user=aUserName&password=3xLVz" | null | "hsqldb:file:" | "hsqldb" | "file" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:file:/loc/hsdb" | null | "hsqldb:file:" | "hsqldb" | "file" | "SA" | null | null | "/loc/hsdb" | null - "jdbc:hsqldb:file:C:/hsdb" | null | "hsqldb:file:" | "hsqldb" | "file" | "SA" | null | null | "c:/hsdb" | null - "jdbc:hsqldb:res:hsdb" | null | "hsqldb:res:" | "hsqldb" | "res" | "SA" | null | null | "hsdb" | null - "jdbc:hsqldb:res:/cp/hsdb" | null | "hsqldb:res:" | "hsqldb" | "res" | "SA" | null | null | "/cp/hsdb" | null - "jdbc:hsqldb:hsql://hs.host:333/hsdb" | null | "hsqldb:hsql://hs.host:333" | "hsqldb" | "hsql" | "SA" | "hs.host" | 333 | "hsdb" | null - "jdbc:hsqldb:hsqls://hs.host/hsdb" | null | "hsqldb:hsqls://hs.host:9001" | "hsqldb" | "hsqls" | "SA" | "hs.host" | 9001 | "hsdb" | null - "jdbc:hsqldb:http://hs.host" | null | "hsqldb:http://hs.host:80" | "hsqldb" | "http" | "SA" | "hs.host" | 80 | null | null - "jdbc:hsqldb:http://hs.host:333/hsdb" | null | "hsqldb:http://hs.host:333" | "hsqldb" | "http" | "SA" | "hs.host" | 333 | "hsdb" | null - "jdbc:hsqldb:https://127.0.0.1/hsdb" | null | "hsqldb:https://127.0.0.1:443" | "hsqldb" | "https" | "SA" | "127.0.0.1" | 443 | "hsdb" | null + "jdbc:hsqldb:hsdb" | null | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:hsdb" | stdProps | "hsqldb" | "mem" | "stdUserName" | null | null | "hsdb" | "stdDatabaseName" + "jdbc:hsqldb:mem:hsdb" | null | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:mem:hsdb;shutdown=true" | null | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:mem:hsdb?shutdown=true" | null | "hsqldb" | "mem" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:file:hsdb" | null | "hsqldb" | "file" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:file:hsdb;user=aUserName;password=3xLVz" | null | "hsqldb" | "file" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:file:hsdb;create=false?user=aUserName&password=3xLVz" | null | "hsqldb" | "file" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:file:/loc/hsdb" | null | "hsqldb" | "file" | "SA" | null | null | "/loc/hsdb" | null + "jdbc:hsqldb:file:C:/hsdb" | null | "hsqldb" | "file" | "SA" | null | null | "c:/hsdb" | null + "jdbc:hsqldb:res:hsdb" | null | "hsqldb" | "res" | "SA" | null | null | "hsdb" | null + "jdbc:hsqldb:res:/cp/hsdb" | null | "hsqldb" | "res" | "SA" | null | null | "/cp/hsdb" | null + "jdbc:hsqldb:hsql://hs.host:333/hsdb" | null | "hsqldb" | "hsql" | "SA" | "hs.host" | 333 | "hsdb" | null + "jdbc:hsqldb:hsqls://hs.host/hsdb" | null | "hsqldb" | "hsqls" | "SA" | "hs.host" | 9001 | "hsdb" | null + "jdbc:hsqldb:http://hs.host" | null | "hsqldb" | "http" | "SA" | "hs.host" | 80 | null | null + "jdbc:hsqldb:http://hs.host:333/hsdb" | null | "hsqldb" | "http" | "SA" | "hs.host" | 333 | "hsdb" | null + "jdbc:hsqldb:https://127.0.0.1/hsdb" | null | "hsqldb" | "https" | "SA" | "127.0.0.1" | 443 | "hsdb" | null // https://db.apache.org/derby/papers/DerbyClientSpec.html#Connection+URL+Format // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp34964.html - "jdbc:derby:derbydb" | null | "derby:directory:" | "derby" | "directory" | "APP" | null | null | "derbydb" | null - "jdbc:derby:derbydb" | stdProps | "derby:directory:" | "derby" | "directory" | "stdUserName" | null | null | "derbydb" | "stdDatabaseName" - "jdbc:derby:derbydb;user=derbyuser;password=pw" | null | "derby:directory:" | "derby" | "directory" | "derbyuser" | null | null | "derbydb" | null - "jdbc:derby:memory:derbydb" | null | "derby:memory:" | "derby" | "memory" | "APP" | null | null | "derbydb" | null - "jdbc:derby:memory:;databaseName=derbydb" | null | "derby:memory:" | "derby" | "memory" | "APP" | null | null | null | "derbydb" - "jdbc:derby:memory:derbydb;databaseName=altdb" | null | "derby:memory:" | "derby" | "memory" | "APP" | null | null | "derbydb" | "altdb" - "jdbc:derby:memory:derbydb;user=derbyuser;password=pw" | null | "derby:memory:" | "derby" | "memory" | "derbyuser" | null | null | "derbydb" | null - "jdbc:derby://derby.host:222/memory:derbydb;create=true" | null | "derby:network://derby.host:222" | "derby" | "network" | "APP" | "derby.host" | 222 | "derbydb" | null - "jdbc:derby://derby.host/memory:derbydb;create=true;user=derbyuser;password=pw" | null | "derby:network://derby.host:1527" | "derby" | "network" | "derbyuser" | "derby.host" | 1527 | "derbydb" | null - "jdbc:derby://127.0.0.1:1527/memory:derbydb;create=true;user=derbyuser;password=pw" | null | "derby:network://127.0.0.1:1527" | "derby" | "network" | "derbyuser" | "127.0.0.1" | 1527 | "derbydb" | null - "jdbc:derby:directory:derbydb;user=derbyuser;password=pw" | null | "derby:directory:" | "derby" | "directory" | "derbyuser" | null | null | "derbydb" | null - "jdbc:derby:classpath:/some/derbydb;user=derbyuser;password=pw" | null | "derby:classpath:" | "derby" | "classpath" | "derbyuser" | null | null | "/some/derbydb" | null - "jdbc:derby:jar:/derbydb;user=derbyuser;password=pw" | null | "derby:jar:" | "derby" | "jar" | "derbyuser" | null | null | "/derbydb" | null - "jdbc:derby:jar:(~/path/to/db.jar)/other/derbydb;user=derbyuser;password=pw" | null | "derby:jar:" | "derby" | "jar" | "derbyuser" | null | null | "(~/path/to/db.jar)/other/derbydb" | null + "jdbc:derby:derbydb" | null | "derby" | "directory" | "APP" | null | null | "derbydb" | null + "jdbc:derby:derbydb" | stdProps | "derby" | "directory" | "stdUserName" | null | null | "derbydb" | "stdDatabaseName" + "jdbc:derby:derbydb;user=derbyuser;password=pw" | null | "derby" | "directory" | "derbyuser" | null | null | "derbydb" | null + "jdbc:derby:memory:derbydb" | null | "derby" | "memory" | "APP" | null | null | "derbydb" | null + "jdbc:derby:memory:;databaseName=derbydb" | null | "derby" | "memory" | "APP" | null | null | null | "derbydb" + "jdbc:derby:memory:derbydb;databaseName=altdb" | null | "derby" | "memory" | "APP" | null | null | "derbydb" | "altdb" + "jdbc:derby:memory:derbydb;user=derbyuser;password=pw" | null | "derby" | "memory" | "derbyuser" | null | null | "derbydb" | null + "jdbc:derby://derby.host:222/memory:derbydb;create=true" | null | "derby" | "network" | "APP" | "derby.host" | 222 | "derbydb" | null + "jdbc:derby://derby.host/memory:derbydb;create=true;user=derbyuser;password=pw" | null | "derby" | "network" | "derbyuser" | "derby.host" | 1527 | "derbydb" | null + "jdbc:derby://127.0.0.1:1527/memory:derbydb;create=true;user=derbyuser;password=pw" | null | "derby" | "network" | "derbyuser" | "127.0.0.1" | 1527 | "derbydb" | null + "jdbc:derby:directory:derbydb;user=derbyuser;password=pw" | null | "derby" | "directory" | "derbyuser" | null | null | "derbydb" | null + "jdbc:derby:classpath:/some/derbydb;user=derbyuser;password=pw" | null | "derby" | "classpath" | "derbyuser" | null | null | "/some/derbydb" | null + "jdbc:derby:jar:/derbydb;user=derbyuser;password=pw" | null | "derby" | "jar" | "derbyuser" | null | null | "/derbydb" | null + "jdbc:derby:jar:(~/path/to/db.jar)/other/derbydb;user=derbyuser;password=pw" | null | "derby" | "jar" | "derbyuser" | null | null | "(~/path/to/db.jar)/other/derbydb" | null // https://docs.progress.com/bundle/datadirect-connect-jdbc-51/page/URL-Formats-DataDirect-Connect-for-JDBC-Drivers.html - "jdbc:datadirect:sqlserver://server_name:1433;DatabaseName=dbname" | null | "datadirect:sqlserver://server_name:1433" | "mssql" | "sqlserver" | null | "server_name" | 1433 | null | "dbname" - "jdbc:datadirect:oracle://server_name:1521;ServiceName=your_servicename" | null | "datadirect:oracle://server_name:1521" | "oracle" | "oracle" | null | "server_name" | 1521 | null | null - "jdbc:datadirect:mysql://server_name:3306" | null | "datadirect:mysql://server_name:3306" | "mysql" | "mysql" | null | "server_name" | 3306 | null | null - "jdbc:datadirect:postgresql://server_name:5432;DatabaseName=dbname" | null | "datadirect:postgresql://server_name:5432" | "postgresql" | "postgresql" | null | "server_name" | 5432 | null | "dbname" - "jdbc:datadirect:db2://server_name:50000;DatabaseName=dbname" | null | "datadirect:db2://server_name:50000" | "db2" | "db2" | null | "server_name" | 50000 | null | "dbname" + "jdbc:datadirect:sqlserver://server_name:1433;DatabaseName=dbname" | null | "mssql" | "sqlserver" | null | "server_name" | 1433 | null | "dbname" + "jdbc:datadirect:oracle://server_name:1521;ServiceName=your_servicename" | null | "oracle" | "oracle" | null | "server_name" | 1521 | null | null + "jdbc:datadirect:mysql://server_name:3306" | null | "mysql" | "mysql" | null | "server_name" | 3306 | null | null + "jdbc:datadirect:postgresql://server_name:5432;DatabaseName=dbname" | null | "postgresql" | "postgresql" | null | "server_name" | 5432 | null | "dbname" + "jdbc:datadirect:db2://server_name:50000;DatabaseName=dbname" | null | "db2" | "db2" | null | "server_name" | 50000 | null | "dbname" // "the TIBCO JDBC drivers are based on the Progress DataDirect Connect drivers" // https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v601/working-data-sources - "jdbc:tibcosoftware:sqlserver://server_name:1433;DatabaseName=dbname" | null | "tibcosoftware:sqlserver://server_name:1433" | "mssql" | "sqlserver" | null | "server_name" | 1433 | null | "dbname" - "jdbc:tibcosoftware:oracle://server_name:1521;ServiceName=your_servicename" | null | "tibcosoftware:oracle://server_name:1521" | "oracle" | "oracle" | null | "server_name" | 1521 | null | null - "jdbc:tibcosoftware:mysql://server_name:3306" | null | "tibcosoftware:mysql://server_name:3306" | "mysql" | "mysql" | null | "server_name" | 3306 | null | null - "jdbc:tibcosoftware:postgresql://server_name:5432;DatabaseName=dbname" | null | "tibcosoftware:postgresql://server_name:5432" | "postgresql" | "postgresql" | null | "server_name" | 5432 | null | "dbname" - "jdbc:tibcosoftware:db2://server_name:50000;DatabaseName=dbname" | null | "tibcosoftware:db2://server_name:50000" | "db2" | "db2" | null | "server_name" | 50000 | null | "dbname" + "jdbc:tibcosoftware:sqlserver://server_name:1433;DatabaseName=dbname" | null | "mssql" | "sqlserver" | null | "server_name" | 1433 | null | "dbname" + "jdbc:tibcosoftware:oracle://server_name:1521;ServiceName=your_servicename" | null | "oracle" | "oracle" | null | "server_name" | 1521 | null | null + "jdbc:tibcosoftware:mysql://server_name:3306" | null | "mysql" | "mysql" | null | "server_name" | 3306 | null | null + "jdbc:tibcosoftware:postgresql://server_name:5432;DatabaseName=dbname" | null | "postgresql" | "postgresql" | null | "server_name" | 5432 | null | "dbname" + "jdbc:tibcosoftware:db2://server_name:50000;DatabaseName=dbname" | null | "db2" | "db2" | null | "server_name" | 50000 | null | "dbname" // https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_jdbc.html - "jdbc-secretsmanager:mysql://example.com:50000" | null | "mysql://example.com:50000" | "mysql" | null | null | "example.com" | 50000 | null | null - "jdbc-secretsmanager:postgresql://example.com:50000/dbname" | null | "postgresql://example.com:50000" | "postgresql" | null | null | "example.com" | 50000 | null | "dbname" - "jdbc-secretsmanager:oracle:thin:@example.com:50000/ORCL" | null | "oracle:thin://example.com:50000" | "oracle" | "thin" | null | "example.com" | 50000 | "orcl" | null - "jdbc-secretsmanager:sqlserver://example.com:50000" | null | "sqlserver://example.com:50000" | "mssql" | null | null | "example.com" | 50000 | null | null + "jdbc-secretsmanager:mysql://example.com:50000" | null | "mysql" | null | null | "example.com" | 50000 | null | null + "jdbc-secretsmanager:postgresql://example.com:50000/dbname" | null | "postgresql" | null | null | "example.com" | 50000 | null | "dbname" + "jdbc-secretsmanager:oracle:thin:@example.com:50000/ORCL" | null | "oracle" | "thin" | null | "example.com" | 50000 | "orcl" | null + "jdbc-secretsmanager:sqlserver://example.com:50000" | null | "mssql" | null | null | "example.com" | 50000 | null | null - expected = DbInfo.builder().system(system).subtype(subtype).user(user).name(name).db(db).host(host).port(port).shortUrl(shortUrl).build() + expected = DbInfo.builder().system(system).subtype(subtype).user(user).name(name).db(db).host(host).port(port).build() } } diff --git a/instrumentation/jdbc/library/src/test/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceTest.java b/instrumentation/jdbc/library/src/test/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceTest.java index 6c775f9c2b7f..6e357d299808 100644 --- a/instrumentation/jdbc/library/src/test/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceTest.java +++ b/instrumentation/jdbc/library/src/test/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceTest.java @@ -33,7 +33,6 @@ class OpenTelemetryDataSourceTest { @RegisterExtension static final InstrumentationExtension testing = LibraryInstrumentationExtension.create(); - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest @ArgumentsSource(GetConnectionMethods.class) void shouldEmitGetConnectionSpans(GetConnectionFunction getConnection) throws SQLException { @@ -56,10 +55,7 @@ void shouldEmitGetConnectionSpans(GetConnectionFunction getConnection) throws SQ TestDataSource.class.getName()), equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "getConnection"), equalTo(DbIncubatingAttributes.DB_SYSTEM, "postgresql"), - equalTo(DbIncubatingAttributes.DB_NAME, "dbname"), - equalTo( - DbIncubatingAttributes.DB_CONNECTION_STRING, - "postgresql://127.0.0.1:5432")))); + equalTo(DbIncubatingAttributes.DB_NAME, "dbname")))); assertThat(connection).isExactlyInstanceOf(OpenTelemetryConnection.class); DbInfo dbInfo = ((OpenTelemetryConnection) connection).getDbInfo(); @@ -101,7 +97,6 @@ interface GetConnectionFunction { private static void assertDbInfo(DbInfo dbInfo) { assertThat(dbInfo.getSystem()).isEqualTo("postgresql"); assertNull(dbInfo.getSubtype()); - assertThat(dbInfo.getShortUrl()).isEqualTo("postgresql://127.0.0.1:5432"); assertNull(dbInfo.getUser()); assertNull(dbInfo.getName()); assertThat(dbInfo.getDb()).isEqualTo("dbname"); diff --git a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesGetter.java b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesGetter.java index 3ae3372ca95f..fe4995e23ca2 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesGetter.java +++ b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisDbAttributesGetter.java @@ -32,11 +32,6 @@ public String getName(JedisRequest request) { return null; } - @Override - public String getConnectionString(JedisRequest request) { - return null; - } - @Override public String getStatement(JedisRequest request) { return sanitizer.sanitize(request.getCommand().name(), request.getArgs()); diff --git a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisDbAttributesGetter.java b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisDbAttributesGetter.java index e2580f553f96..6f22f1e381d2 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisDbAttributesGetter.java +++ b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisDbAttributesGetter.java @@ -27,11 +27,6 @@ public String getName(JedisRequest request) { return null; } - @Override - public String getConnectionString(JedisRequest request) { - return null; - } - @Override public String getStatement(JedisRequest request) { return request.getStatement(); diff --git a/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisDbAttributesGetter.java b/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisDbAttributesGetter.java index 4d77c785d768..cabcdc384f68 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisDbAttributesGetter.java +++ b/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisDbAttributesGetter.java @@ -27,11 +27,6 @@ public String getName(JedisRequest request) { return null; } - @Override - public String getConnectionString(JedisRequest request) { - return null; - } - @Override public String getStatement(JedisRequest request) { return request.getStatement(); diff --git a/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceDbAttributesGetter.java b/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceDbAttributesGetter.java index 0322e0e61dd9..e46b39237e57 100644 --- a/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceDbAttributesGetter.java +++ b/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceDbAttributesGetter.java @@ -29,12 +29,6 @@ public String getName(RedisCommand request) { return null; } - @Override - @Nullable - public String getConnectionString(RedisCommand request) { - return null; - } - @Override public String getStatement(RedisCommand request) { return null; diff --git a/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceDbAttributesGetter.java b/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceDbAttributesGetter.java index 6ecbaa3d1ee9..bff3ef0b4fa4 100644 --- a/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceDbAttributesGetter.java +++ b/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceDbAttributesGetter.java @@ -37,12 +37,6 @@ public String getName(RedisCommand request) { return null; } - @Override - @Nullable - public String getConnectionString(RedisCommand request) { - return null; - } - @Override public String getStatement(RedisCommand request) { String command = LettuceInstrumentationUtil.getCommandName(request); diff --git a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetter.java b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetter.java index 453c9bddf69a..d1208f21a0d8 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetter.java +++ b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetter.java @@ -5,8 +5,6 @@ package io.opentelemetry.instrumentation.mongo.v3_1; -import com.mongodb.ServerAddress; -import com.mongodb.connection.ConnectionDescription; import com.mongodb.event.CommandStartedEvent; import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientAttributesGetter; import io.opentelemetry.semconv.incubating.DbIncubatingAttributes; @@ -64,24 +62,6 @@ public String getName(CommandStartedEvent event) { return event.getDatabaseName(); } - @Override - @Nullable - public String getConnectionString(CommandStartedEvent event) { - ConnectionDescription connectionDescription = event.getConnectionDescription(); - if (connectionDescription != null) { - ServerAddress sa = connectionDescription.getServerAddress(); - if (sa != null) { - // https://docs.mongodb.com/manual/reference/connection-string/ - String host = sa.getHost(); - int port = sa.getPort(); - if (host != null && port != 0) { - return "mongodb://" + host + ":" + port; - } - } - } - return null; - } - @Override public String getStatement(CommandStartedEvent event) { return sanitizeStatement(event.getCommand()); diff --git a/instrumentation/mongo/mongo-common/testing/src/main/groovy/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.groovy b/instrumentation/mongo/mongo-common/testing/src/main/groovy/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.groovy index 2bde12c163a0..66a82b627610 100644 --- a/instrumentation/mongo/mongo-common/testing/src/main/groovy/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.groovy +++ b/instrumentation/mongo/mongo-common/testing/src/main/groovy/io/opentelemetry/instrumentation/mongo/testing/AbstractMongoClientTest.groovy @@ -399,7 +399,6 @@ abstract class AbstractMongoClientTest extends InstrumentationSpecification { return "testCollection-${collectionIndex.getAndIncrement()}" } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def mongoSpan(TraceAssert trace, int index, String operation, String collection, String dbName, Object parentSpan, @@ -419,7 +418,6 @@ abstract class AbstractMongoClientTest extends InstrumentationSpecification { statementEval.call(it.replaceAll(" ", "")) } "$DbIncubatingAttributes.DB_SYSTEM" "mongodb" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "mongodb://localhost:" + port "$DbIncubatingAttributes.DB_NAME" dbName "$DbIncubatingAttributes.DB_OPERATION" operation "$DbIncubatingAttributes.DB_MONGODB_COLLECTION" collection diff --git a/instrumentation/opensearch/opensearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/rest/OpenSearchRestAttributesGetter.java b/instrumentation/opensearch/opensearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/rest/OpenSearchRestAttributesGetter.java index 79e70641dfd9..598809a96cff 100644 --- a/instrumentation/opensearch/opensearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/rest/OpenSearchRestAttributesGetter.java +++ b/instrumentation/opensearch/opensearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/rest/OpenSearchRestAttributesGetter.java @@ -29,12 +29,6 @@ public String getName(OpenSearchRestRequest request) { return null; } - @Override - @Nullable - public String getConnectionString(OpenSearchRestRequest request) { - return null; - } - @Override @Nullable public String getStatement(OpenSearchRestRequest request) { diff --git a/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/DbExecution.java b/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/DbExecution.java index 1bd64b05926e..e0ba6cc65b57 100644 --- a/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/DbExecution.java +++ b/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/DbExecution.java @@ -6,10 +6,8 @@ package io.opentelemetry.instrumentation.r2dbc.v1_0.internal; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; -import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import static io.r2dbc.spi.ConnectionFactoryOptions.HOST; import static io.r2dbc.spi.ConnectionFactoryOptions.PORT; -import static io.r2dbc.spi.ConnectionFactoryOptions.PROTOCOL; import static io.r2dbc.spi.ConnectionFactoryOptions.USER; import io.opentelemetry.context.Context; @@ -31,7 +29,6 @@ public final class DbExecution { private final String name; private final String host; private final Integer port; - private final String connectionString; private final String rawStatement; private Context context; @@ -51,19 +48,8 @@ public DbExecution(QueryExecutionInfo queryInfo, ConnectionFactoryOptions factor factoryOptions.hasOption(DATABASE) ? ((String) factoryOptions.getValue(DATABASE)).toLowerCase(Locale.ROOT) : null; - String driver = - factoryOptions.hasOption(DRIVER) ? (String) factoryOptions.getValue(DRIVER) : null; - String protocol = - factoryOptions.hasOption(PROTOCOL) ? (String) factoryOptions.getValue(PROTOCOL) : null; this.host = factoryOptions.hasOption(HOST) ? (String) factoryOptions.getValue(HOST) : null; this.port = factoryOptions.hasOption(PORT) ? (Integer) factoryOptions.getValue(PORT) : null; - this.connectionString = - String.format( - "%s%s:%s%s", - driver != null ? driver : "", - protocol != null ? ":" + protocol : "", - host != null ? "//" + host : "", - port != null ? ":" + port : ""); this.rawStatement = queryInfo.getQueries().stream().map(QueryInfo::getQuery).collect(Collectors.joining(";\n")); } @@ -88,10 +74,6 @@ public String getName() { return name; } - public String getConnectionString() { - return connectionString; - } - public String getRawStatement() { return rawStatement; } @@ -121,8 +103,6 @@ public String toString() { + '\'' + ", port=" + port - + ", connectionString='" - + connectionString + '\'' + ", rawStatement='" + rawStatement diff --git a/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/R2dbcSqlAttributesGetter.java b/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/R2dbcSqlAttributesGetter.java index 6b7bcbb41ff6..946c82e9a42a 100644 --- a/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/R2dbcSqlAttributesGetter.java +++ b/instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/internal/R2dbcSqlAttributesGetter.java @@ -32,12 +32,6 @@ public String getName(DbExecution request) { return request.getName(); } - @Override - @Nullable - public String getConnectionString(DbExecution request) { - return request.getConnectionString(); - } - @Override @Nullable public String getRawStatement(DbExecution request) { diff --git a/instrumentation/r2dbc-1.0/library/src/test/java/io/opentelemetry/instrumentation/r2dbc/v1_0/DbExecutionTest.java b/instrumentation/r2dbc-1.0/library/src/test/java/io/opentelemetry/instrumentation/r2dbc/v1_0/DbExecutionTest.java index b7de3b7c05a5..5048553e1cae 100644 --- a/instrumentation/r2dbc-1.0/library/src/test/java/io/opentelemetry/instrumentation/r2dbc/v1_0/DbExecutionTest.java +++ b/instrumentation/r2dbc-1.0/library/src/test/java/io/opentelemetry/instrumentation/r2dbc/v1_0/DbExecutionTest.java @@ -44,7 +44,6 @@ void dbExecution() { assertEquals("db", dbExecution.getName()); assertEquals("localhost", dbExecution.getHost()); assertEquals(3306, dbExecution.getPort()); - assertEquals("mariadb://localhost:3306", dbExecution.getConnectionString()); assertEquals("SELECT * from person where last_name = 'tom'", dbExecution.getRawStatement()); } } diff --git a/instrumentation/r2dbc-1.0/testing/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/AbstractR2dbcStatementTest.java b/instrumentation/r2dbc-1.0/testing/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/AbstractR2dbcStatementTest.java index 3d85dab01a75..6cc1416f937c 100644 --- a/instrumentation/r2dbc-1.0/testing/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/AbstractR2dbcStatementTest.java +++ b/instrumentation/r2dbc-1.0/testing/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/AbstractR2dbcStatementTest.java @@ -8,7 +8,6 @@ import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS; import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT; -import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_CONNECTION_STRING; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_NAME; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SQL_TABLE; @@ -124,7 +123,6 @@ void startContainer(DbSystemProps props) { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @ParameterizedTest(name = "{index}: {0}") @MethodSource("provideParameters") void testQueries(Parameter parameter) { @@ -166,9 +164,6 @@ void testQueries(Parameter parameter) { .hasKind(SpanKind.CLIENT) .hasParent(trace.getSpan(0)) .hasAttributesSatisfyingExactly( - equalTo( - DB_CONNECTION_STRING, - parameter.system + "://localhost:" + port), equalTo(DB_SYSTEM, parameter.system), equalTo(DB_NAME, DB), equalTo(DB_USER, USER_DB), diff --git a/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaAttributesGetter.java b/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaAttributesGetter.java index a99f63faebc2..697ca4b69911 100644 --- a/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaAttributesGetter.java +++ b/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaAttributesGetter.java @@ -30,12 +30,6 @@ public String getName(RedisCommand redisCommand) { return null; } - @Override - @Nullable - public String getConnectionString(RedisCommand redisCommand) { - return null; - } - @Override @Nullable public String getStatement(RedisCommand redisCommand) { diff --git a/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesGetter.java b/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesGetter.java index e11f73ec316a..76ea19a05d4c 100644 --- a/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesGetter.java +++ b/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonDbAttributesGetter.java @@ -28,11 +28,6 @@ public String getName(RedissonRequest request) { return null; } - @Override - public String getConnectionString(RedissonRequest request) { - return null; - } - @Override public String getStatement(RedissonRequest request) { return request.getStatement(); diff --git a/instrumentation/spring/spring-data/spring-data-3.0/testing/src/reactiveTest/java/io/opentelemetry/javaagent/instrumentation/spring/data/v3_0/ReactiveSpringDataTest.java b/instrumentation/spring/spring-data/spring-data-3.0/testing/src/reactiveTest/java/io/opentelemetry/javaagent/instrumentation/spring/data/v3_0/ReactiveSpringDataTest.java index 826bf0877497..4918f7aa02b7 100644 --- a/instrumentation/spring/spring-data/spring-data-3.0/testing/src/reactiveTest/java/io/opentelemetry/javaagent/instrumentation/spring/data/v3_0/ReactiveSpringDataTest.java +++ b/instrumentation/spring/spring-data/spring-data-3.0/testing/src/reactiveTest/java/io/opentelemetry/javaagent/instrumentation/spring/data/v3_0/ReactiveSpringDataTest.java @@ -7,7 +7,6 @@ import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS; -import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_CONNECTION_STRING; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_NAME; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SQL_TABLE; @@ -49,7 +48,6 @@ static void cleanUp() { applicationContext.close(); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testFindAll() { long count = @@ -87,7 +85,6 @@ void testFindAll() { equalTo(DB_STATEMENT, "SELECT CUSTOMER.* FROM CUSTOMER"), equalTo(DB_OPERATION, "SELECT"), equalTo(DB_SQL_TABLE, "CUSTOMER"), - equalTo(DB_CONNECTION_STRING, "h2:mem://localhost"), equalTo(SERVER_ADDRESS, "localhost")))); } } diff --git a/instrumentation/spring/spring-data/spring-data-common/testing/src/main/java/AbstractSpringJpaTest.java b/instrumentation/spring/spring-data/spring-data-common/testing/src/main/java/AbstractSpringJpaTest.java index 670999905aa5..29072d4648ea 100644 --- a/instrumentation/spring/spring-data/spring-data-common/testing/src/main/java/AbstractSpringJpaTest.java +++ b/instrumentation/spring/spring-data/spring-data-common/testing/src/main/java/AbstractSpringJpaTest.java @@ -66,7 +66,6 @@ void testObjectMethod() { span -> span.hasName("toString test").hasTotalAttributeCount(0))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation static void assertHibernate4Trace(TraceAssert trace, String repoClassName) { trace.hasSpansSatisfyingExactly( span -> @@ -83,14 +82,12 @@ static void assertHibernate4Trace(TraceAssert trace, String repoClassName) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("insert ")), equalTo(DbIncubatingAttributes.DB_OPERATION, "INSERT"), equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "JpaCustomer"))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation static void assertHibernateTrace(TraceAssert trace, String repoClassName) { trace.hasSpansSatisfyingExactly( span -> @@ -106,7 +103,6 @@ static void assertHibernateTrace(TraceAssert trace, String repoClassName) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("call next value for ")), @@ -119,14 +115,12 @@ static void assertHibernateTrace(TraceAssert trace, String repoClassName) { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("insert ")), equalTo(DbIncubatingAttributes.DB_OPERATION, "INSERT"), equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "JpaCustomer"))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testCrud() { boolean isHibernate4 = Version.getVersionString().startsWith("4."); @@ -155,7 +149,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), @@ -193,7 +186,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), @@ -207,7 +199,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("update ")), @@ -233,7 +224,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), @@ -259,7 +249,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), @@ -273,7 +262,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("delete ")), @@ -281,7 +269,6 @@ void testCrud() { equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "JpaCustomer")))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testCustomRepositoryMethod() { REPOSITORY repo = repository(); @@ -308,7 +295,6 @@ void testCustomRepositoryMethod() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), @@ -316,7 +302,6 @@ void testCustomRepositoryMethod() { equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "JpaCustomer")))); } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation @Test void testFailedRepositoryMethod() { // given @@ -355,7 +340,6 @@ void testFailedRepositoryMethod() { equalTo(DbIncubatingAttributes.DB_SYSTEM, "hsqldb"), equalTo(DbIncubatingAttributes.DB_NAME, "test"), equalTo(DbIncubatingAttributes.DB_USER, "sa"), - equalTo(DbIncubatingAttributes.DB_CONNECTION_STRING, "hsqldb:mem:"), satisfies( DbIncubatingAttributes.DB_STATEMENT, val -> val.startsWith("select ")), diff --git a/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedAttributesGetter.java b/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedAttributesGetter.java index b5778dc96a32..97c75001feaf 100644 --- a/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedAttributesGetter.java +++ b/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedAttributesGetter.java @@ -27,12 +27,6 @@ public String getName(SpymemcachedRequest spymemcachedRequest) { return null; } - @Override - @Nullable - public String getConnectionString(SpymemcachedRequest spymemcachedRequest) { - return null; - } - @Override @Nullable public String getStatement(SpymemcachedRequest spymemcachedRequest) { diff --git a/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientAttributesGetter.java b/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientAttributesGetter.java index da2cb4f6cf94..c8776c85ce54 100644 --- a/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientAttributesGetter.java +++ b/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientAttributesGetter.java @@ -35,12 +35,6 @@ public String getName(VertxRedisClientRequest request) { return null; } - @Override - @Nullable - public String getConnectionString(VertxRedisClientRequest request) { - return request.getConnectionString(); - } - @Override public String getStatement(VertxRedisClientRequest request) { return sanitizer.sanitize(request.getCommand(), request.getArgs()); diff --git a/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientRequest.java b/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientRequest.java index f202034b7849..50a8597b6bf3 100644 --- a/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientRequest.java +++ b/instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/redis/VertxRedisClientRequest.java @@ -41,10 +41,6 @@ public Long getDatabaseIndex() { return select != null ? select.longValue() : null; } - public String getConnectionString() { - return null; - } - public String getHost() { return redisUri.socketAddress().host(); } diff --git a/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/latestDepTest/groovy/VertxReactivePropagationTest.groovy b/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/latestDepTest/groovy/VertxReactivePropagationTest.groovy index 7e776c9ab177..873a4f3b7875 100644 --- a/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/latestDepTest/groovy/VertxReactivePropagationTest.groovy +++ b/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/latestDepTest/groovy/VertxReactivePropagationTest.groovy @@ -53,7 +53,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { //Verifies that context is correctly propagated and sql query span has correct parent. //Tests io.opentelemetry.javaagent.instrumentation.vertx.reactive.VertxRxInstrumentation - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "should propagate context over vert.x rx-java framework"() { setup: def response = client.get("/listProducts").aggregate().join() @@ -101,7 +100,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "SA" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" "SELECT id, name, price, weight FROM products" "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "products" @@ -111,7 +109,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { } } - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "should propagate context correctly over vert.x rx-java framework with high concurrency"() { setup: int count = 100 @@ -201,7 +198,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "SA" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" "SELECT id AS request$requestId, name, price, weight FROM products" "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "products" diff --git a/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/groovy/VertxReactivePropagationTest.groovy b/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/groovy/VertxReactivePropagationTest.groovy index 9490912c8f93..873a4f3b7875 100644 --- a/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/groovy/VertxReactivePropagationTest.groovy +++ b/instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/groovy/VertxReactivePropagationTest.groovy @@ -53,7 +53,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { //Verifies that context is correctly propagated and sql query span has correct parent. //Tests io.opentelemetry.javaagent.instrumentation.vertx.reactive.VertxRxInstrumentation - @SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation def "should propagate context over vert.x rx-java framework"() { setup: def response = client.get("/listProducts").aggregate().join() @@ -101,7 +100,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "SA" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" "SELECT id, name, price, weight FROM products" "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "products" @@ -200,7 +198,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification { "$DbIncubatingAttributes.DB_SYSTEM" "hsqldb" "$DbIncubatingAttributes.DB_NAME" "test" "$DbIncubatingAttributes.DB_USER" "SA" - "$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:" "$DbIncubatingAttributes.DB_STATEMENT" "SELECT id AS request$requestId, name, price, weight FROM products" "$DbIncubatingAttributes.DB_OPERATION" "SELECT" "$DbIncubatingAttributes.DB_SQL_TABLE" "products" diff --git a/instrumentation/vertx/vertx-sql-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql/VertxSqlClientAttributesGetter.java b/instrumentation/vertx/vertx-sql-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql/VertxSqlClientAttributesGetter.java index 4fa4a6ea5359..5e58757c77d4 100644 --- a/instrumentation/vertx/vertx-sql-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql/VertxSqlClientAttributesGetter.java +++ b/instrumentation/vertx/vertx-sql-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/v4_0/sql/VertxSqlClientAttributesGetter.java @@ -29,12 +29,6 @@ public String getName(VertxSqlClientRequest request) { return request.getDatabase(); } - @Override - @Nullable - public String getConnectionString(VertxSqlClientRequest request) { - return null; - } - @Override @Nullable public String getRawStatement(VertxSqlClientRequest request) { From 76ffad591bbb705934bf235354cea1877e04e435 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Fri, 12 Apr 2024 08:01:39 +0300 Subject: [PATCH 2/2] Update instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java --- .../incubator/semconv/db/DbClientCommonAttributesGetter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java index feaf91d2f68f..da9be4f901cf 100644 --- a/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java +++ b/instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java @@ -19,7 +19,7 @@ public interface DbClientCommonAttributesGetter { @Nullable String getName(REQUEST request); - // to be removed in the next release, use `server.address` and `server.port` instead + // to be removed in 2.4.0, use `server.address` and `server.port` instead @Nullable @Deprecated default String getConnectionString(REQUEST request) {