Skip to content

Commit 9b8732f

Browse files
committed
migrate to stable semconv when we can
1 parent 3609e6d commit 9b8732f

File tree

16 files changed

+95
-95
lines changed

16 files changed

+95
-95
lines changed

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.opentelemetry.context.Context;
1414
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
1515
import io.opentelemetry.instrumentation.api.internal.SemconvStability;
16+
import io.opentelemetry.semconv.DbAttributes;
1617
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
1718
import java.util.Collections;
1819
import java.util.HashMap;
@@ -85,15 +86,15 @@ void shouldExtractAllAvailableAttributes() {
8586
assertThat(startAttributes.build())
8687
.containsOnly(
8788
entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"),
88-
entry(DbIncubatingAttributes.DB_SYSTEM_NAME, "myDb"),
89+
entry(DbAttributes.DB_SYSTEM_NAME, "myDb"),
8990
entry(DbIncubatingAttributes.DB_USER, "username"),
9091
entry(DbIncubatingAttributes.DB_NAME, "potatoes"),
9192
entry(DbIncubatingAttributes.DB_CONNECTION_STRING, "mydb:///potatoes"),
9293
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato"),
9394
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
94-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
95-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
96-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
95+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
96+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
97+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"));
9798
} else if (SemconvStability.emitOldDatabaseSemconv()) {
9899
assertThat(startAttributes.build())
99100
.containsOnly(
@@ -106,10 +107,10 @@ void shouldExtractAllAvailableAttributes() {
106107
} else if (SemconvStability.emitStableDatabaseSemconv()) {
107108
assertThat(startAttributes.build())
108109
.containsOnly(
109-
entry(DbIncubatingAttributes.DB_SYSTEM_NAME, "myDb"),
110-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
111-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
112-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
110+
entry(DbAttributes.DB_SYSTEM_NAME, "myDb"),
111+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
112+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
113+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"));
113114
}
114115

115116
assertThat(endAttributes.build().isEmpty()).isTrue();

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.opentelemetry.context.Context;
1717
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
1818
import io.opentelemetry.instrumentation.api.internal.SemconvStability;
19+
import io.opentelemetry.semconv.DbAttributes;
1920
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
2021
import java.util.Arrays;
2122
import java.util.Collection;
@@ -118,17 +119,17 @@ void shouldExtractAllAttributes() {
118119
assertThat(startAttributes.build())
119120
.containsOnly(
120121
entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"),
121-
entry(DbIncubatingAttributes.DB_SYSTEM_NAME, "myDb"),
122+
entry(DbAttributes.DB_SYSTEM_NAME, "myDb"),
122123
entry(DbIncubatingAttributes.DB_USER, "username"),
123124
entry(DbIncubatingAttributes.DB_NAME, "potatoes"),
124125
entry(DbIncubatingAttributes.DB_CONNECTION_STRING, "mydb:///potatoes"),
125126
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato WHERE id=?"),
126127
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
127128
entry(DbIncubatingAttributes.DB_SQL_TABLE, "potato"),
128-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
129-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato WHERE id=?"),
130-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
131-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"));
129+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
130+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM potato WHERE id=?"),
131+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"),
132+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"));
132133
} else if (SemconvStability.emitOldDatabaseSemconv()) {
133134
assertThat(startAttributes.build())
134135
.containsOnly(
@@ -142,11 +143,11 @@ void shouldExtractAllAttributes() {
142143
} else if (SemconvStability.emitStableDatabaseSemconv()) {
143144
assertThat(startAttributes.build())
144145
.containsOnly(
145-
entry(DbIncubatingAttributes.DB_SYSTEM_NAME, "myDb"),
146-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
147-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato WHERE id=?"),
148-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
149-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"));
146+
entry(DbAttributes.DB_SYSTEM_NAME, "myDb"),
147+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
148+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM potato WHERE id=?"),
149+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"),
150+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"));
150151
}
151152

152153
assertThat(endAttributes.build().isEmpty()).isTrue();
@@ -173,8 +174,8 @@ void shouldNotExtractTableIfAttributeIsNotSet() {
173174
.containsOnly(
174175
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT *"),
175176
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
176-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT *"),
177-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
177+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT *"),
178+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"));
178179
} else if (SemconvStability.emitOldDatabaseSemconv()) {
179180
assertThat(attributes.build())
180181
.containsOnly(
@@ -183,8 +184,8 @@ void shouldNotExtractTableIfAttributeIsNotSet() {
183184
} else if (SemconvStability.emitStableDatabaseSemconv()) {
184185
assertThat(attributes.build())
185186
.containsOnly(
186-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT *"),
187-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
187+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT *"),
188+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"));
188189
}
189190
}
190191

@@ -213,9 +214,9 @@ void shouldExtractTableToSpecifiedKey() {
213214
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM table"),
214215
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
215216
entry(DbIncubatingAttributes.DB_CASSANDRA_TABLE, "table"),
216-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM table"),
217-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
218-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "table"));
217+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM table"),
218+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"),
219+
entry(DbAttributes.DB_COLLECTION_NAME, "table"));
219220
} else if (SemconvStability.emitOldDatabaseSemconv()) {
220221
assertThat(attributes.build())
221222
.containsOnly(
@@ -225,9 +226,9 @@ void shouldExtractTableToSpecifiedKey() {
225226
} else if (SemconvStability.emitStableDatabaseSemconv()) {
226227
assertThat(attributes.build())
227228
.containsOnly(
228-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM table"),
229-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"),
230-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "table"));
229+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM table"),
230+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"),
231+
entry(DbAttributes.DB_COLLECTION_NAME, "table"));
231232
}
232233
}
233234

@@ -273,11 +274,11 @@ void shouldExtractSingleQueryBatchAttributes() {
273274
entry(DbIncubatingAttributes.DB_STATEMENT, "INSERT INTO potato VALUES(?)"),
274275
entry(DbIncubatingAttributes.DB_OPERATION, "INSERT"),
275276
entry(DbIncubatingAttributes.DB_SQL_TABLE, "potato"),
276-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
277-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
278-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
279-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"),
280-
entry(DbIncubatingAttributes.DB_OPERATION_BATCH_SIZE, 2L));
277+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
278+
entry(DbAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
279+
entry(DbAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
280+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"),
281+
entry(DbAttributes.DB_OPERATION_BATCH_SIZE, 2L));
281282
} else if (SemconvStability.emitOldDatabaseSemconv()) {
282283
assertThat(startAttributes.build())
283284
.containsOnly(
@@ -288,11 +289,11 @@ void shouldExtractSingleQueryBatchAttributes() {
288289
} else if (SemconvStability.emitStableDatabaseSemconv()) {
289290
assertThat(startAttributes.build())
290291
.containsOnly(
291-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
292-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
293-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
294-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"),
295-
entry(DbIncubatingAttributes.DB_OPERATION_BATCH_SIZE, 2L));
292+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
293+
entry(DbAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
294+
entry(DbAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
295+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"),
296+
entry(DbAttributes.DB_OPERATION_BATCH_SIZE, 2L));
296297
}
297298

298299
assertThat(endAttributes.build().isEmpty()).isTrue();
@@ -325,22 +326,22 @@ void shouldExtractMultiQueryBatchAttributes() {
325326
assertThat(startAttributes.build())
326327
.containsOnly(
327328
entry(DbIncubatingAttributes.DB_NAME, "potatoes"),
328-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
329-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
330-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
331-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"),
332-
entry(DbIncubatingAttributes.DB_OPERATION_BATCH_SIZE, 2L));
329+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
330+
entry(DbAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
331+
entry(DbAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
332+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"),
333+
entry(DbAttributes.DB_OPERATION_BATCH_SIZE, 2L));
333334
} else if (SemconvStability.emitOldDatabaseSemconv()) {
334335
assertThat(startAttributes.build())
335336
.containsOnly(entry(DbIncubatingAttributes.DB_NAME, "potatoes"));
336337
} else if (SemconvStability.emitStableDatabaseSemconv()) {
337338
assertThat(startAttributes.build())
338339
.containsOnly(
339-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
340-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
341-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
342-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"),
343-
entry(DbIncubatingAttributes.DB_OPERATION_BATCH_SIZE, 2L));
340+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
341+
entry(DbAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
342+
entry(DbAttributes.DB_OPERATION_NAME, "BATCH INSERT"),
343+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"),
344+
entry(DbAttributes.DB_OPERATION_BATCH_SIZE, 2L));
344345
}
345346

346347
assertThat(endAttributes.build().isEmpty()).isTrue();
@@ -374,10 +375,10 @@ void shouldIgnoreBatchSizeOne() {
374375
entry(DbIncubatingAttributes.DB_STATEMENT, "INSERT INTO potato VALUES(?)"),
375376
entry(DbIncubatingAttributes.DB_OPERATION, "INSERT"),
376377
entry(DbIncubatingAttributes.DB_SQL_TABLE, "potato"),
377-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
378-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
379-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "INSERT"),
380-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"));
378+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
379+
entry(DbAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
380+
entry(DbAttributes.DB_OPERATION_NAME, "INSERT"),
381+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"));
381382
} else if (SemconvStability.emitOldDatabaseSemconv()) {
382383
assertThat(startAttributes.build())
383384
.containsOnly(
@@ -388,10 +389,10 @@ void shouldIgnoreBatchSizeOne() {
388389
} else if (SemconvStability.emitStableDatabaseSemconv()) {
389390
assertThat(startAttributes.build())
390391
.containsOnly(
391-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
392-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
393-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "INSERT"),
394-
entry(DbIncubatingAttributes.DB_COLLECTION_NAME, "potato"));
392+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
393+
entry(DbAttributes.DB_QUERY_TEXT, "INSERT INTO potato VALUES(?)"),
394+
entry(DbAttributes.DB_OPERATION_NAME, "INSERT"),
395+
entry(DbAttributes.DB_COLLECTION_NAME, "potato"));
395396
}
396397

397398
assertThat(endAttributes.build().isEmpty()).isTrue();

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractDynamoDbClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
import static io.opentelemetry.instrumentation.testing.junit.db.DbClientMetricsTestUtil.assertDurationMetric;
1010
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
1111
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
12+
import static io.opentelemetry.semconv.DbAttributes.DB_OPERATION_NAME;
13+
import static io.opentelemetry.semconv.DbAttributes.DB_SYSTEM_NAME;
1214
import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
1315
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
1416
import static io.opentelemetry.semconv.incubating.AwsIncubatingAttributes.AWS_DYNAMODB_TABLE_NAMES;
1517
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
16-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION_NAME;
1718
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
18-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM_NAME;
1919
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DbSystemNameIncubatingValues.AWS_DYNAMODB;
2020
import static java.util.Collections.singletonList;
2121

instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientCoreTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
1111
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStableDbSystemName;
1212
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
13+
import static io.opentelemetry.semconv.DbAttributes.DB_OPERATION_NAME;
14+
import static io.opentelemetry.semconv.DbAttributes.DB_SYSTEM_NAME;
1315
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
1416
import static io.opentelemetry.semconv.HttpAttributes.HTTP_RESPONSE_STATUS_CODE;
1517
import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
1618
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
1719
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
1820
import static io.opentelemetry.semconv.incubating.AwsIncubatingAttributes.AWS_REQUEST_ID;
1921
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
20-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION_NAME;
2122
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
22-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM_NAME;
2323
import static io.opentelemetry.semconv.incubating.RpcIncubatingAttributes.RPC_METHOD;
2424
import static io.opentelemetry.semconv.incubating.RpcIncubatingAttributes.RPC_SERVICE;
2525
import static io.opentelemetry.semconv.incubating.RpcIncubatingAttributes.RPC_SYSTEM;
@@ -104,7 +104,6 @@ void prepTest() {
104104
server.beforeTestExecution(null);
105105
}
106106

107-
@SuppressWarnings("deprecation") // using deprecated semconv
108107
private void validateOperationResponse(String operation, Object response) {
109108
assertThat(response).isNotNull();
110109
assertThat(response.getClass().getSimpleName()).startsWith(operation);

instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/DbSpanDecorator.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import io.opentelemetry.instrumentation.api.internal.SemconvStability;
2929
import io.opentelemetry.javaagent.bootstrap.internal.AgentCommonConfig;
3030
import io.opentelemetry.javaagent.instrumentation.apachecamel.CamelDirection;
31+
import io.opentelemetry.semconv.DbAttributes;
3132
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
3233
import java.net.URI;
3334
import java.util.Map;
@@ -125,15 +126,15 @@ public void pre(
125126
super.pre(attributes, exchange, endpoint, camelDirection);
126127

127128
if (SemconvStability.emitStableDatabaseSemconv()) {
128-
attributes.put(DbIncubatingAttributes.DB_SYSTEM_NAME, system);
129+
attributes.put(DbAttributes.DB_SYSTEM_NAME, system);
129130
}
130131
if (SemconvStability.emitOldDatabaseSemconv()) {
131132
attributes.put(DbIncubatingAttributes.DB_SYSTEM, system);
132133
}
133134
String statement = getStatement(exchange, endpoint);
134135
if (statement != null) {
135136
if (SemconvStability.emitStableDatabaseSemconv()) {
136-
attributes.put(DbIncubatingAttributes.DB_QUERY_TEXT, statement);
137+
attributes.put(DbAttributes.DB_QUERY_TEXT, statement);
137138
}
138139
if (SemconvStability.emitOldDatabaseSemconv()) {
139140
attributes.put(DbIncubatingAttributes.DB_STATEMENT, statement);
@@ -142,7 +143,7 @@ public void pre(
142143
String dbName = getDbName(endpoint);
143144
if (dbName != null) {
144145
if (SemconvStability.emitStableDatabaseSemconv()) {
145-
attributes.put(DbIncubatingAttributes.DB_NAMESPACE, dbName);
146+
attributes.put(DbAttributes.DB_NAMESPACE, dbName);
146147
}
147148
if (SemconvStability.emitOldDatabaseSemconv()) {
148149
attributes.put(DbIncubatingAttributes.DB_NAME, dbName);

instrumentation/clickhouse-client-0.5/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/clickhouse/ClickHouseClientTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
99
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
10+
import static io.opentelemetry.semconv.DbAttributes.DB_RESPONSE_STATUS_CODE;
1011
import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE;
1112
import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
1213
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
1314
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_NAME;
1415
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
15-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_RESPONSE_STATUS_CODE;
1616
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_STATEMENT;
1717
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
1818
import static java.util.Arrays.asList;
@@ -185,7 +185,6 @@ void testExecuteAndWaitWithStringQueryAndId() throws ClickHouseException {
185185
}
186186

187187
@Test
188-
@SuppressWarnings("deprecation") // using deprecated semconv
189188
void testExecuteAndWaitThrowsException() {
190189
Throwable thrown =
191190
catchThrowable(

0 commit comments

Comments
 (0)