Remove db.connection_string (#11089)

This commit is contained in:
Lauri Tulmin 2024-04-12 09:09:25 +03:00 committed by GitHub
parent a1466adff0
commit 7ff3b23f10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
54 changed files with 135 additions and 484 deletions

View File

@ -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

View File

@ -19,6 +19,10 @@ public interface DbClientCommonAttributesGetter<REQUEST> {
@Nullable
String getName(REQUEST request);
// to be removed in 2.4.0, use `server.address` and `server.port` instead
@Nullable
String getConnectionString(REQUEST request);
@Deprecated
default String getConnectionString(REQUEST request) {
return null;
}
}

View File

@ -36,11 +36,6 @@ class DbClientAttributesExtractorTest {
return map.get("db.name");
}
@Override
public String getConnectionString(Map<String, String> map) {
return map.get("db.connection_string");
}
@Override
public String getStatement(Map<String, String> map) {
return map.get("db.statement");
@ -52,7 +47,6 @@ class DbClientAttributesExtractorTest {
}
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void shouldExtractAllAvailableAttributes() {
// given
@ -60,7 +54,6 @@ class DbClientAttributesExtractorTest {
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 @@ class DbClientAttributesExtractorTest {
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"));

View File

@ -42,14 +42,8 @@ class SqlClientAttributesExtractorTest {
public String getName(Map<String, String> map) {
return map.get("db.name");
}
@Override
public String getConnectionString(Map<String, String> map) {
return map.get("db.connection_string");
}
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void shouldExtractAllAttributes() {
// given
@ -57,7 +51,6 @@ class SqlClientAttributesExtractorTest {
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 @@ class SqlClientAttributesExtractorTest {
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"));

View File

@ -28,12 +28,6 @@ final class CassandraSqlAttributesGetter implements SqlClientAttributesGetter<Ca
return request.getSession().getLoggedKeyspace();
}
@Override
@Nullable
public String getConnectionString(CassandraRequest request) {
return null;
}
@Override
@Nullable
public String getRawStatement(CassandraRequest request) {

View File

@ -29,12 +29,6 @@ final class CassandraSqlAttributesGetter implements SqlClientAttributesGetter<Ca
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) {

View File

@ -29,12 +29,6 @@ final class CassandraSqlAttributesGetter implements SqlClientAttributesGetter<Ca
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) {

View File

@ -28,12 +28,6 @@ final class CouchbaseAttributesGetter implements DbClientAttributesGetter<Couchb
return couchbaseRequest.bucket();
}
@Override
@Nullable
public String getConnectionString(CouchbaseRequestInfo couchbaseRequest) {
return null;
}
@Override
@Nullable
public String getStatement(CouchbaseRequestInfo couchbaseRequest) {

View File

@ -51,12 +51,6 @@ final class ElasticsearchDbAttributesGetter
return null;
}
@Override
@Nullable
public String getConnectionString(ElasticsearchRestRequest request) {
return null;
}
@Override
@Nullable
public String getStatement(ElasticsearchRestRequest request) {

View File

@ -29,12 +29,6 @@ final class ElasticsearchTransportAttributesGetter
return null;
}
@Override
@Nullable
public String getConnectionString(ElasticTransportRequest s) {
return null;
}
@Override
@Nullable
public String getStatement(ElasticTransportRequest s) {

View File

@ -32,12 +32,6 @@ final class GeodeDbAttributesGetter implements DbClientAttributesGetter<GeodeReq
return request.getRegion().getName();
}
@Override
@Nullable
public String getConnectionString(GeodeRequest request) {
return null;
}
@Override
@Nullable
public String getStatement(GeodeRequest request) {

View File

@ -57,7 +57,6 @@ abstract class AbstractHibernateTest extends AgentInstrumentationSpecification {
}
}
@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 @@ abstract class AbstractHibernateTest extends AgentInstrumentationSpecification {
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 @@ abstract class AbstractHibernateTest extends AgentInstrumentationSpecification {
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))),

View File

@ -69,7 +69,6 @@ class CriteriaTest extends AbstractHibernateTest {
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")),

View File

@ -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 @@ class EntityManagerTest extends AbstractHibernateTest {
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 @@ class EntityManagerTest extends AbstractHibernateTest {
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 @@ class EntityManagerTest extends AbstractHibernateTest {
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 @@ class EntityManagerTest extends AbstractHibernateTest {
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 @@ class EntityManagerTest extends AbstractHibernateTest {
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 @@ class EntityManagerTest extends AbstractHibernateTest {
equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "Value"))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest
@MethodSource("provideArgumentsAttachesState")
void testAttachesStateToQuery(Function<EntityManager, Query> queryBuildMethod) {
@ -295,7 +288,6 @@ class EntityManagerTest extends AbstractHibernateTest {
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)),

View File

@ -25,7 +25,6 @@ import org.junit.jupiter.params.provider.MethodSource;
class QueryTest extends AbstractHibernateTest {
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testHibernateQueryExecuteUpdateWithTransaction() {
testing.runWithSpan(
@ -64,7 +63,6 @@ class QueryTest extends AbstractHibernateTest {
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 @@ class QueryTest extends AbstractHibernateTest {
.get(stringKey("hibernate.session_id"))))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest
@MethodSource("providesArgumentsSingleCall")
void testHibernateQuerySingleCall(Parameter parameter) {
@ -122,7 +119,6 @@ class QueryTest extends AbstractHibernateTest {
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 @@ class QueryTest extends AbstractHibernateTest {
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 @@ class QueryTest extends AbstractHibernateTest {
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 ")),

View File

@ -34,7 +34,6 @@ import org.junit.jupiter.params.provider.MethodSource;
@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 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
null))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest
@MethodSource("provideArgumentsHibernateActionStateless")
void testHibernateActionStateless(Parameter parameter) {
@ -178,7 +175,6 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
}))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest
@MethodSource("provideArgumentsHibernateReplicate")
void testHibernateReplicate(Parameter parameter) {
@ -325,7 +320,6 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
.get(stringKey("hibernate.session_id"))))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest
@MethodSource("provideArgumentsHibernateCommitAction")
void testHibernateCommitAction(Parameter parameter) {
@ -485,7 +477,6 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
null))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest
@MethodSource("provideArgumentsStateQuery")
void testAttachesStateToQueryCreated(Consumer<Session> queryBuilder) {
@ -664,7 +654,6 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
session -> session.createSQLQuery("SELECT * FROM Value").list())))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testHibernateOverlappingSessions() {
testing.runWithSpan(
@ -765,7 +753,6 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
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 @@ class SessionTest extends AbstractHibernateTest {
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")),

View File

@ -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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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 @@ class SpringJpaTest {
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=?"),

View File

@ -36,7 +36,6 @@ public class CriteriaTest extends AbstractHibernateTest {
Arguments.of(named("getSingleResultOrNull", interactions.get(2))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest(name = "{index}: {0}")
@MethodSource("provideParameters")
void testCriteriaQuery(Consumer<Query<Value>> interaction) {
@ -79,7 +78,6 @@ public class CriteriaTest extends AbstractHibernateTest {
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")),

View File

@ -112,7 +112,6 @@ public class EntityManagerTest extends AbstractHibernateTest {
});
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest(name = "{index}: {0}")
@MethodSource("provideAttachesStateParameters")
void testAttachesStateToQuery(Parameter parameter) {
@ -141,7 +140,6 @@ public class EntityManagerTest extends AbstractHibernateTest {
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 @@ public class EntityManagerTest extends AbstractHibernateTest {
public final Function<EntityManager, Query> 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 @@ public class EntityManagerTest extends AbstractHibernateTest {
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 @@ public class EntityManagerTest extends AbstractHibernateTest {
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"));

View File

@ -69,7 +69,6 @@ public class ProcedureCallTest {
}
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testProcedureCall() {
testing.runWithSpan(
@ -105,7 +104,6 @@ public class ProcedureCallTest {
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 ->

View File

@ -219,7 +219,6 @@ public class SessionTest extends AbstractHibernateTest {
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 @@ public class SessionTest extends AbstractHibernateTest {
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 @@ public class SessionTest extends AbstractHibernateTest {
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 @@ public class SessionTest extends AbstractHibernateTest {
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 @@ public class SessionTest extends AbstractHibernateTest {
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))),

View File

@ -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"

View File

@ -76,7 +76,6 @@ class ProcedureCallTest {
}
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testProcedureCall() {
@ -118,7 +117,6 @@ class ProcedureCallTest {
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")

View File

@ -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"

View File

@ -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")
)

View File

@ -21,7 +21,6 @@ enum DataSourceDbAttributesExtractor implements AttributesExtractor<DataSource,
@Override
public void onStart(AttributesBuilder attributes, Context parentContext, DataSource dataSource) {}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Override
public void onEnd(
AttributesBuilder attributes,
@ -35,7 +34,6 @@ enum DataSourceDbAttributesExtractor implements AttributesExtractor<DataSource,
internalSet(attributes, DbIncubatingAttributes.DB_SYSTEM, dbInfo.getSystem());
internalSet(attributes, DbIncubatingAttributes.DB_USER, dbInfo.getUser());
internalSet(attributes, DbIncubatingAttributes.DB_NAME, getName(dbInfo));
internalSet(attributes, DbIncubatingAttributes.DB_CONNECTION_STRING, dbInfo.getShortUrl());
}
private static String getName(DbInfo dbInfo) {

View File

@ -34,12 +34,6 @@ public final class JdbcAttributesGetter implements SqlClientAttributesGetter<DbR
return dbInfo.getName() == null ? dbInfo.getDb() : dbInfo.getName();
}
@Nullable
@Override
public String getConnectionString(DbRequest request) {
return request.getDbInfo().getShortUrl();
}
@Nullable
@Override
public String getRawStatement(DbRequest request) {

View File

@ -887,38 +887,15 @@ public enum JdbcConnectionUrlParser {
try {
if (typeParsers.containsKey(type)) {
// Delegate to specific parser
return withUrl(typeParsers.get(type).doParse(jdbcUrl, parsedProps), type);
return typeParsers.get(type).doParse(jdbcUrl, parsedProps).build();
}
return withUrl(GENERIC_URL_LIKE.doParse(jdbcUrl, parsedProps), type);
return GENERIC_URL_LIKE.doParse(jdbcUrl, parsedProps).build();
} catch (RuntimeException e) {
logger.log(FINE, "Error parsing URL", e);
return parsedProps.build();
}
}
private static DbInfo withUrl(DbInfo.Builder builder, String type) {
DbInfo info = builder.build();
StringBuilder url = new StringBuilder();
url.append(type);
url.append(':');
String subtype = info.getSubtype();
if (subtype != null) {
url.append(subtype);
url.append(':');
}
String host = info.getHost();
if (host != null) {
url.append("//");
url.append(host);
Integer port = info.getPort();
if (port != null) {
url.append(':');
url.append(port);
}
}
return builder.shortUrl(url.toString()).build();
}
// Source: https://stackoverflow.com/a/13592567
private static Map<String, String> splitQuery(String query, String separator) {
if (query == null || query.isEmpty()) {

View File

@ -27,10 +27,6 @@ public abstract class DbInfo {
@Nullable
public abstract String getSubtype();
// "type:[subtype:]//host:port"
@Nullable
public abstract String getShortUrl();
@Nullable
public abstract String getUser();
@ -50,7 +46,6 @@ public abstract class DbInfo {
return builder()
.system(getSystem())
.subtype(getSubtype())
.shortUrl(getShortUrl())
.user(getUser())
.name(getName())
.db(getDb())
@ -69,8 +64,6 @@ public abstract class DbInfo {
public abstract Builder subtype(String subtype);
public abstract Builder shortUrl(String shortUrl);
public abstract Builder user(String user);
public abstract Builder name(String name);

View File

@ -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")

View File

@ -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()
}
}

View File

@ -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 @@ class OpenTelemetryDataSourceTest {
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 @@ class OpenTelemetryDataSourceTest {
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");

View File

@ -32,11 +32,6 @@ final class JedisDbAttributesGetter implements DbClientAttributesGetter<JedisReq
return null;
}
@Override
public String getConnectionString(JedisRequest request) {
return null;
}
@Override
public String getStatement(JedisRequest request) {
return sanitizer.sanitize(request.getCommand().name(), request.getArgs());

View File

@ -27,11 +27,6 @@ final class JedisDbAttributesGetter implements DbClientAttributesGetter<JedisReq
return null;
}
@Override
public String getConnectionString(JedisRequest request) {
return null;
}
@Override
public String getStatement(JedisRequest request) {
return request.getStatement();

View File

@ -27,11 +27,6 @@ final class JedisDbAttributesGetter implements DbClientAttributesGetter<JedisReq
return null;
}
@Override
public String getConnectionString(JedisRequest request) {
return null;
}
@Override
public String getStatement(JedisRequest request) {
return request.getStatement();

View File

@ -29,12 +29,6 @@ final class LettuceDbAttributesGetter implements DbClientAttributesGetter<RedisC
return null;
}
@Override
@Nullable
public String getConnectionString(RedisCommand<?, ?, ?> request) {
return null;
}
@Override
public String getStatement(RedisCommand<?, ?, ?> request) {
return null;

View File

@ -37,12 +37,6 @@ final class LettuceDbAttributesGetter implements DbClientAttributesGetter<RedisC
return null;
}
@Override
@Nullable
public String getConnectionString(RedisCommand<?, ?, ?> request) {
return null;
}
@Override
public String getStatement(RedisCommand<?, ?, ?> request) {
String command = LettuceInstrumentationUtil.getCommandName(request);

View File

@ -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 @@ class MongoDbAttributesGetter implements DbClientAttributesGetter<CommandStarted
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());

View File

@ -399,7 +399,6 @@ abstract class AbstractMongoClientTest<T> 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<T> 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

View File

@ -29,12 +29,6 @@ final class OpenSearchRestAttributesGetter
return null;
}
@Override
@Nullable
public String getConnectionString(OpenSearchRestRequest request) {
return null;
}
@Override
@Nullable
public String getStatement(OpenSearchRestRequest request) {

View File

@ -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 final class DbExecution {
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 final class DbExecution {
return name;
}
public String getConnectionString() {
return connectionString;
}
public String getRawStatement() {
return rawStatement;
}
@ -121,8 +103,6 @@ public final class DbExecution {
+ '\''
+ ", port="
+ port
+ ", connectionString='"
+ connectionString
+ '\''
+ ", rawStatement='"
+ rawStatement

View File

@ -32,12 +32,6 @@ public enum R2dbcSqlAttributesGetter implements SqlClientAttributesGetter<DbExec
return request.getName();
}
@Override
@Nullable
public String getConnectionString(DbExecution request) {
return request.getConnectionString();
}
@Override
@Nullable
public String getRawStatement(DbExecution request) {

View File

@ -44,7 +44,6 @@ class DbExecutionTest {
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());
}
}

View File

@ -8,7 +8,6 @@ package io.opentelemetry.instrumentation.r2dbc.v1_0;
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 @@ public abstract class AbstractR2dbcStatementTest {
}
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@ParameterizedTest(name = "{index}: {0}")
@MethodSource("provideParameters")
void testQueries(Parameter parameter) {
@ -166,9 +164,6 @@ public abstract class AbstractR2dbcStatementTest {
.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),

View File

@ -30,12 +30,6 @@ final class RediscalaAttributesGetter implements DbClientAttributesGetter<RedisC
return null;
}
@Override
@Nullable
public String getConnectionString(RedisCommand<?, ?> redisCommand) {
return null;
}
@Override
@Nullable
public String getStatement(RedisCommand<?, ?> redisCommand) {

View File

@ -28,11 +28,6 @@ final class RedissonDbAttributesGetter implements DbClientAttributesGetter<Redis
return null;
}
@Override
public String getConnectionString(RedissonRequest request) {
return null;
}
@Override
public String getStatement(RedissonRequest request) {
return request.getStatement();

View File

@ -7,7 +7,6 @@ package io.opentelemetry.javaagent.instrumentation.spring.data.v3_0;
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 @@ class ReactiveSpringDataTest {
applicationContext.close();
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testFindAll() {
long count =
@ -87,7 +85,6 @@ class ReactiveSpringDataTest {
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"))));
}
}

View File

@ -66,7 +66,6 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "JpaCustomer"))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testCustomRepositoryMethod() {
REPOSITORY repo = repository();
@ -308,7 +295,6 @@ public abstract class AbstractSpringJpaTest<
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 @@ public abstract class AbstractSpringJpaTest<
equalTo(DbIncubatingAttributes.DB_SQL_TABLE, "JpaCustomer"))));
}
@SuppressWarnings("deprecation") // TODO DbIncubatingAttributes.DB_CONNECTION_STRING deprecation
@Test
void testFailedRepositoryMethod() {
// given
@ -355,7 +340,6 @@ public abstract class AbstractSpringJpaTest<
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 ")),

View File

@ -27,12 +27,6 @@ public class SpymemcachedAttributesGetter implements DbClientAttributesGetter<Sp
return null;
}
@Override
@Nullable
public String getConnectionString(SpymemcachedRequest spymemcachedRequest) {
return null;
}
@Override
@Nullable
public String getStatement(SpymemcachedRequest spymemcachedRequest) {

View File

@ -35,12 +35,6 @@ public enum VertxRedisClientAttributesGetter
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());

View File

@ -41,10 +41,6 @@ public final class VertxRedisClientRequest {
return select != null ? select.longValue() : null;
}
public String getConnectionString() {
return null;
}
public String getHost() {
return redisUri.socketAddress().host();
}

View File

@ -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"

View File

@ -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"

View File

@ -29,12 +29,6 @@ public enum VertxSqlClientAttributesGetter
return request.getDatabase();
}
@Override
@Nullable
public String getConnectionString(VertxSqlClientRequest request) {
return null;
}
@Override
@Nullable
public String getRawStatement(VertxSqlClientRequest request) {