@@ -14,6 +14,7 @@ import spring.jpa.PersistenceConfig
1414
1515import static io.opentelemetry.api.trace.SpanKind.CLIENT
1616import static io.opentelemetry.api.trace.SpanKind.INTERNAL
17+ import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv
1718import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable
1819
1920class SpringJpaTest extends AgentInstrumentationSpecification {
@@ -64,8 +65,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
6465 attributes {
6566 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
6667 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
67- " $DbIncubatingAttributes . DB_USER " " sa"
68- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
68+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
69+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
6970 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName(.*)from Customer(.*)/
7071 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " SELECT"
7172 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -120,9 +121,9 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
120121 attributes {
121122 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
122123 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
123- " $DbIncubatingAttributes . DB_USER " " sa"
124+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
124125 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " " call next value for Customer_SEQ"
125- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
126+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
126127 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " CALL"
127128 }
128129 }
@@ -141,8 +142,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
141142 attributes {
142143 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
143144 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
144- " $DbIncubatingAttributes . DB_USER " " sa"
145- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
145+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
146+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
146147 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ insert into Customer \( .*\) values \( .*\) /
147148 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " INSERT"
148149 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -156,8 +157,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
156157 attributes {
157158 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
158159 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
159- " $DbIncubatingAttributes . DB_USER " " sa"
160- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
160+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
161+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
161162 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ insert into Customer \( .*\) values \( .*\) /
162163 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " INSERT"
163164 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -211,8 +212,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
211212 attributes {
212213 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
213214 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
214- " $DbIncubatingAttributes . DB_USER " " sa"
215- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
215+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
216+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
216217 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
217218 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " SELECT"
218219 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -232,8 +233,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
232233 attributes {
233234 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
234235 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
235- " $DbIncubatingAttributes . DB_USER " " sa"
236- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
236+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
237+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
237238 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ update Customer set firstName=\? ,(.*)lastName=\? where id=\? /
238239 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " UPDATE"
239240 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -275,8 +276,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
275276 attributes {
276277 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
277278 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
278- " $DbIncubatingAttributes . DB_USER " " sa"
279- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
279+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
280+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
280281 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)(where ([^.]+)\. lastName( ?)=( ?)\? |)/
281282 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " SELECT"
282283 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -319,8 +320,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
319320 attributes {
320321 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
321322 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
322- " $DbIncubatingAttributes . DB_USER " " sa"
323- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
323+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
324+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
324325 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
325326 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " SELECT"
326327 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -344,8 +345,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
344345 attributes {
345346 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
346347 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
347- " $DbIncubatingAttributes . DB_USER " " sa"
348- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
348+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
349+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
349350 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
350351 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " SELECT"
351352 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
@@ -374,8 +375,8 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
374375 attributes {
375376 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
376377 " ${ maybeStable(DbIncubatingAttributes.DB_NAME)} " " test"
377- " $DbIncubatingAttributes . DB_USER " " sa"
378- " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
378+ " $DbIncubatingAttributes . DB_USER " emitStableDatabaseSemconv() ? null : " sa"
379+ " $DbIncubatingAttributes . DB_CONNECTION_STRING " emitStableDatabaseSemconv() ? null : " hsqldb:mem:"
379380 " ${ maybeStable(DbIncubatingAttributes.DB_STATEMENT)} " " delete from Customer where id=?"
380381 " ${ maybeStable(DbIncubatingAttributes.DB_OPERATION)} " " DELETE"
381382 " ${ maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)} " " Customer"
0 commit comments