Skip to content

Commit d50a999

Browse files
committed
script groovy
1 parent 9432e76 commit d50a999

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed

instrumentation/hibernate/hibernate-6.0/spring-testing/src/test/groovy/SpringJpaTest.groovy

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import spring.jpa.PersistenceConfig
1414

1515
import static io.opentelemetry.api.trace.SpanKind.CLIENT
1616
import static io.opentelemetry.api.trace.SpanKind.INTERNAL
17+
import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv
1718
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable
1819

1920
class 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"

instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/latestDepTest/groovy/VertxReactivePropagationTest.groovy

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import static VertxReactiveWebServer.TEST_REQUEST_ID_ATTRIBUTE
2424
import static VertxReactiveWebServer.TEST_REQUEST_ID_PARAMETER
2525
import static io.opentelemetry.api.trace.SpanKind.CLIENT
2626
import static io.opentelemetry.api.trace.SpanKind.SERVER
27+
import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv
2728
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable
2829
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS
2930

@@ -96,8 +97,8 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
9697
attributes {
9798
"$DbIncubatingAttributes.DB_SYSTEM" "hsqldb"
9899
"${maybeStable(DbIncubatingAttributes.DB_NAME)}" "test"
99-
"$DbIncubatingAttributes.DB_USER" "SA"
100-
"$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:"
100+
"$DbIncubatingAttributes.DB_USER" emitStableDatabaseSemconv() ? null : "SA"
101+
"$DbIncubatingAttributes.DB_CONNECTION_STRING" emitStableDatabaseSemconv() ? null : "hsqldb:mem:"
101102
"${maybeStable(DbIncubatingAttributes.DB_STATEMENT)}" "SELECT id, name, price, weight FROM products"
102103
"${maybeStable(DbIncubatingAttributes.DB_OPERATION)}" "SELECT"
103104
"${maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)}" "products"
@@ -196,8 +197,8 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
196197
attributes {
197198
"$DbIncubatingAttributes.DB_SYSTEM" "hsqldb"
198199
"${maybeStable(DbIncubatingAttributes.DB_NAME)}" "test"
199-
"$DbIncubatingAttributes.DB_USER" "SA"
200-
"$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:"
200+
"$DbIncubatingAttributes.DB_USER" emitStableDatabaseSemconv() ? null : "SA"
201+
"$DbIncubatingAttributes.DB_CONNECTION_STRING" emitStableDatabaseSemconv() ? null : "hsqldb:mem:"
201202
"${maybeStable(DbIncubatingAttributes.DB_STATEMENT)}" "SELECT id AS request$requestId, name, price, weight FROM products"
202203
"${maybeStable(DbIncubatingAttributes.DB_OPERATION)}" "SELECT"
203204
"${maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)}" "products"

instrumentation/vertx/vertx-rx-java-3.5/javaagent/src/version35Test/groovy/VertxReactivePropagationTest.groovy

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import static VertxReactiveWebServer.TEST_REQUEST_ID_ATTRIBUTE
2424
import static VertxReactiveWebServer.TEST_REQUEST_ID_PARAMETER
2525
import static io.opentelemetry.api.trace.SpanKind.CLIENT
2626
import static io.opentelemetry.api.trace.SpanKind.SERVER
27+
import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv
2728
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable
2829
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS
2930

@@ -96,8 +97,8 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
9697
attributes {
9798
"$DbIncubatingAttributes.DB_SYSTEM" "hsqldb"
9899
"${maybeStable(DbIncubatingAttributes.DB_NAME)}" "test"
99-
"$DbIncubatingAttributes.DB_USER" "SA"
100-
"$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:"
100+
"$DbIncubatingAttributes.DB_USER" emitStableDatabaseSemconv() ? null : "SA"
101+
"$DbIncubatingAttributes.DB_CONNECTION_STRING" emitStableDatabaseSemconv() ? null : "hsqldb:mem:"
101102
"${maybeStable(DbIncubatingAttributes.DB_STATEMENT)}" "SELECT id, name, price, weight FROM products"
102103
"${maybeStable(DbIncubatingAttributes.DB_OPERATION)}" "SELECT"
103104
"${maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)}" "products"
@@ -195,8 +196,8 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
195196
attributes {
196197
"$DbIncubatingAttributes.DB_SYSTEM" "hsqldb"
197198
"${maybeStable(DbIncubatingAttributes.DB_NAME)}" "test"
198-
"$DbIncubatingAttributes.DB_USER" "SA"
199-
"$DbIncubatingAttributes.DB_CONNECTION_STRING" "hsqldb:mem:"
199+
"$DbIncubatingAttributes.DB_USER" emitStableDatabaseSemconv() ? null : "SA"
200+
"$DbIncubatingAttributes.DB_CONNECTION_STRING" emitStableDatabaseSemconv() ? null : "hsqldb:mem:"
200201
"${maybeStable(DbIncubatingAttributes.DB_STATEMENT)}" "SELECT id AS request$requestId, name, price, weight FROM products"
201202
"${maybeStable(DbIncubatingAttributes.DB_OPERATION)}" "SELECT"
202203
"${maybeStable(DbIncubatingAttributes.DB_SQL_TABLE)}" "products"

0 commit comments

Comments
 (0)