@@ -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.testing.junit.db.SemconvStabilityUtil.maybeStable
1718
1819class SpringJpaTest extends AgentInstrumentationSpecification {
1920
@@ -62,12 +63,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
6263 childOf span(1 )
6364 attributes {
6465 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
65- " $DbIncubatingAttributes . DB_NAME " " test"
66+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
6667 " $DbIncubatingAttributes . DB_USER " " sa"
6768 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
68- " $DbIncubatingAttributes . DB_STATEMENT " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName(.*)from Customer(.*)/
69- " $DbIncubatingAttributes . DB_OPERATION " " SELECT"
70- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
69+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName(.*)from Customer(.*)/
70+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " SELECT"
71+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
7172 }
7273 }
7374 span(3 ) {
@@ -118,11 +119,11 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
118119 childOf span(1 )
119120 attributes {
120121 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
121- " $DbIncubatingAttributes . DB_NAME " " test"
122+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
122123 " $DbIncubatingAttributes . DB_USER " " sa"
123- " $DbIncubatingAttributes . DB_STATEMENT " " call next value for Customer_SEQ"
124+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " " call next value for Customer_SEQ"
124125 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
125- " $DbIncubatingAttributes . DB_OPERATION " " CALL"
126+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " CALL"
126127 }
127128 }
128129 span(3 ) {
@@ -139,12 +140,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
139140 childOf span(3 )
140141 attributes {
141142 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
142- " $DbIncubatingAttributes . DB_NAME " " test"
143+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
143144 " $DbIncubatingAttributes . DB_USER " " sa"
144145 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
145- " $DbIncubatingAttributes . DB_STATEMENT " ~/ insert into Customer \( .*\) values \( .*\) /
146- " $DbIncubatingAttributes . DB_OPERATION " " INSERT"
147- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
146+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ insert into Customer \( .*\) values \( .*\) /
147+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " INSERT"
148+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
148149 }
149150 }
150151 } else {
@@ -154,12 +155,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
154155 childOf span(1 )
155156 attributes {
156157 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
157- " $DbIncubatingAttributes . DB_NAME " " test"
158+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
158159 " $DbIncubatingAttributes . DB_USER " " sa"
159160 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
160- " $DbIncubatingAttributes . DB_STATEMENT " ~/ insert into Customer \( .*\) values \( .*\) /
161- " $DbIncubatingAttributes . DB_OPERATION " " INSERT"
162- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
161+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ insert into Customer \( .*\) values \( .*\) /
162+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " INSERT"
163+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
163164 }
164165 }
165166 span(3 ) {
@@ -209,12 +210,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
209210 kind CLIENT
210211 attributes {
211212 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
212- " $DbIncubatingAttributes . DB_NAME " " test"
213+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
213214 " $DbIncubatingAttributes . DB_USER " " sa"
214215 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
215- " $DbIncubatingAttributes . DB_STATEMENT " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
216- " $DbIncubatingAttributes . DB_OPERATION " " SELECT"
217- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
216+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
217+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " SELECT"
218+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
218219 }
219220 }
220221 span(3 ) {
@@ -230,12 +231,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
230231 kind CLIENT
231232 attributes {
232233 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
233- " $DbIncubatingAttributes . DB_NAME " " test"
234+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
234235 " $DbIncubatingAttributes . DB_USER " " sa"
235236 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
236- " $DbIncubatingAttributes . DB_STATEMENT " ~/ update Customer set firstName=\? ,(.*)lastName=\? where id=\? /
237- " $DbIncubatingAttributes . DB_OPERATION " " UPDATE"
238- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
237+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ update Customer set firstName=\? ,(.*)lastName=\? where id=\? /
238+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " UPDATE"
239+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
239240 }
240241 }
241242 }
@@ -273,12 +274,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
273274 childOf span(1 )
274275 attributes {
275276 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
276- " $DbIncubatingAttributes . DB_NAME " " test"
277+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
277278 " $DbIncubatingAttributes . DB_USER " " sa"
278279 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
279- " $DbIncubatingAttributes . DB_STATEMENT " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)(where ([^.]+)\. lastName( ?)=( ?)\? |)/
280- " $DbIncubatingAttributes . DB_OPERATION " " SELECT"
281- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
280+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)(where ([^.]+)\. lastName( ?)=( ?)\? |)/
281+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " SELECT"
282+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
282283 }
283284 }
284285 }
@@ -317,12 +318,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
317318 childOf span(1 )
318319 attributes {
319320 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
320- " $DbIncubatingAttributes . DB_NAME " " test"
321+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
321322 " $DbIncubatingAttributes . DB_USER " " sa"
322323 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
323- " $DbIncubatingAttributes . DB_STATEMENT " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
324- " $DbIncubatingAttributes . DB_OPERATION " " SELECT"
325- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
324+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
325+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " SELECT"
326+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
326327 }
327328 }
328329 }
@@ -342,12 +343,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
342343 childOf span(1 )
343344 attributes {
344345 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
345- " $DbIncubatingAttributes . DB_NAME " " test"
346+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
346347 " $DbIncubatingAttributes . DB_USER " " sa"
347348 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
348- " $DbIncubatingAttributes . DB_STATEMENT " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
349- " $DbIncubatingAttributes . DB_OPERATION " " SELECT"
350- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
349+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " ~/ select ([^.]+)\. id([^,]*),([^.]+)\. firstName([^,]*),([^.]+)\. lastName (.*)from Customer (.*)where ([^.]+)\. id( ?)=( ?)\? /
350+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " SELECT"
351+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
351352 }
352353 }
353354 }
@@ -372,12 +373,12 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
372373 kind CLIENT
373374 attributes {
374375 " $DbIncubatingAttributes . DB_SYSTEM " " hsqldb"
375- " $DbIncubatingAttributes . DB_NAME " " test"
376+ " ${ maybeStable( DbIncubatingAttributes.DB_NAME) } " " test"
376377 " $DbIncubatingAttributes . DB_USER " " sa"
377378 " $DbIncubatingAttributes . DB_CONNECTION_STRING " " hsqldb:mem:"
378- " $DbIncubatingAttributes . DB_STATEMENT " " delete from Customer where id=?"
379- " $DbIncubatingAttributes . DB_OPERATION " " DELETE"
380- " $DbIncubatingAttributes . DB_SQL_TABLE " " Customer"
379+ " ${ maybeStable( DbIncubatingAttributes.DB_STATEMENT) } " " delete from Customer where id=?"
380+ " ${ maybeStable( DbIncubatingAttributes.DB_OPERATION) } " " DELETE"
381+ " ${ maybeStable( DbIncubatingAttributes.DB_SQL_TABLE) } " " Customer"
381382 }
382383 }
383384 }
0 commit comments