Skip to content

Commit a356cdd

Browse files
committed
merge main
2 parents 3f68ad5 + b586bc2 commit a356cdd

File tree

11 files changed

+62
-72
lines changed

11 files changed

+62
-72
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
### Migration notes
6+
7+
- The configuration option used to enable traces generated by the `dropwizard-views` instrumentation has changed from `otel.instrumentation.common.experimental.controller-telemetry.enabled` to `otel.instrumentation.common.experimental.view-telemetry.enabled`
8+
([#14475](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/14475))
9+
510
## Version 2.19.0 (2025-08-17)
611

712
### 📈 Enhancements

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesGetter.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,16 @@
1010
/** An interface for getting attributes common to database clients. */
1111
public interface DbClientCommonAttributesGetter<REQUEST, RESPONSE> {
1212

13-
@Deprecated
14-
@Nullable
15-
default String getSystem(REQUEST request) {
16-
return null;
17-
}
18-
19-
// TODO: make this required to implement
20-
@Nullable
21-
default String getDbSystem(REQUEST request) {
22-
return getSystem(request);
23-
}
13+
String getDbSystem(REQUEST request);
2414

2515
@Deprecated
2616
@Nullable
2717
default String getUser(REQUEST request) {
2818
return null;
2919
}
3020

31-
/**
32-
* @deprecated Use {@link #getDbNamespace(Object)} instead.
33-
*/
34-
@Deprecated
35-
@Nullable
36-
default String getName(REQUEST request) {
37-
return null;
38-
}
39-
40-
// TODO: make this required to implement
4121
@Nullable
42-
default String getDbNamespace(REQUEST request) {
43-
return getName(request);
44-
}
22+
String getDbNamespace(REQUEST request);
4523

4624
@Deprecated
4725
@Nullable

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
*
2828
* <p>It sets the same set of attributes as {@link DbClientAttributesExtractor} plus an additional
2929
* <code>db.sql.table</code> attribute. The raw SQL statements returned by the {@link
30-
* SqlClientAttributesGetter#getRawQueryText(Object)} method are sanitized before use, all statement
31-
* parameters are removed.
30+
* SqlClientAttributesGetter#getRawQueryTexts(Object)} method are sanitized before use, all
31+
* statement parameters are removed.
3232
*/
3333
public final class SqlClientAttributesExtractor<REQUEST, RESPONSE>
3434
extends DbClientCommonAttributesExtractor<

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesGetter.java

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55

66
package io.opentelemetry.instrumentation.api.incubator.semconv.db;
77

8-
import static java.util.Collections.emptySet;
9-
import static java.util.Collections.singleton;
10-
118
import java.util.Collection;
129
import java.util.Collections;
1310
import java.util.Map;
14-
import javax.annotation.Nullable;
1511

1612
/**
1713
* An interface for getting SQL database client attributes.
@@ -27,42 +23,14 @@
2723
public interface SqlClientAttributesGetter<REQUEST, RESPONSE>
2824
extends DbClientCommonAttributesGetter<REQUEST, RESPONSE> {
2925

30-
/**
31-
* Get the raw SQL statement. The value returned by this method is later sanitized by the {@link
32-
* SqlClientAttributesExtractor} before being set as span attribute.
33-
*
34-
* @deprecated Use {@link #getRawQueryText(Object)} instead.
35-
*/
36-
@Deprecated
37-
@Nullable
38-
default String getRawStatement(REQUEST request) {
39-
return null;
40-
}
41-
42-
/**
43-
* Get the raw SQL query text. The value returned by this method is later sanitized by the {@link
44-
* SqlClientAttributesExtractor} before being set as span attribute.
45-
*
46-
* @deprecated Use {@link #getRawQueryTexts(Object)} instead.
47-
*/
48-
@Deprecated
49-
@Nullable
50-
default String getRawQueryText(REQUEST request) {
51-
return getRawStatement(request);
52-
}
53-
5426
/**
5527
* Get the raw SQL query texts. The values returned by this method is later sanitized by the
5628
* {@link SqlClientAttributesExtractor} before being set as span attribute.
5729
*
5830
* <p>If {@code request} is not a batch query, then this method should return a collection with a
5931
* single element.
6032
*/
61-
// TODO: make this required to implement
62-
default Collection<String> getRawQueryTexts(REQUEST request) {
63-
String rawQueryText = getRawQueryText(request);
64-
return rawQueryText == null ? emptySet() : singleton(rawQueryText);
65-
}
33+
Collection<String> getRawQueryTexts(REQUEST request);
6634

6735
// TODO: make this required to implement
6836
default Long getBatchSize(REQUEST request) {

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/internal/InstrumenterContextTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ void testSqlSanitizer() {
3434
String testQuery = "SELECT name FROM test WHERE id = 1";
3535
SqlClientAttributesGetter<Object, Void> getter =
3636
new SqlClientAttributesGetter<Object, Void>() {
37+
@Override
38+
public String getDbSystem(Object o) {
39+
return "testdb";
40+
}
41+
42+
@Override
43+
public String getDbNamespace(Object o) {
44+
return null;
45+
}
3746

3847
@Override
3948
public Collection<String> getRawQueryTexts(Object request) {

instrumentation/dropwizard/dropwizard-views-0.7/javaagent/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies {
1818
}
1919

2020
tasks.withType<Test>().configureEach {
21-
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
21+
jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true")
2222

2323
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
2424
systemProperty("metadataConfig", "otel.instrumentation.common.experimental.controller-telemetry.enabled=true")

instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public final class DropwizardSingletons {
1717
private static final Instrumenter<View, Void> INSTRUMENTER =
1818
Instrumenter.<View, Void>builder(
1919
GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, DropwizardSingletons::spanName)
20-
.setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled())
20+
.setEnabled(ExperimentalConfig.get().viewTelemetryEnabled())
2121
.buildInstrumenter();
2222

2323
private static String spanName(View view) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description: This instrumentation enables the creation of spans for Dropwizard views.
22
configurations:
3-
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
4-
description: Enables the creation of experimental controller (INTERNAL) spans.
3+
- name: otel.instrumentation.common.experimental.view-telemetry.enabled
4+
description: Enables the creation of experimental view (INTERNAL) spans.
55
type: boolean
66
default: false
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
description: >
2-
This instrumentation enables client spans for Elasticsearch transport client requests. Each call
3-
produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
2+
This instrumentation enables client spans and metrics for Elasticsearch transport client requests.
3+
Each call produces a span named after the Elasticsearch action, enriched with transport-specific
4+
attributes.
45
configurations:
56
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
6-
description: Enable the capture of experimental span attributes.
7+
description: >
8+
Enable the capture of experimental span attributes including `elasticsearch.action`,
9+
`elasticsearch.request`, `elasticsearch.request.indices`,
10+
`elasticsearch.request.search.types`, `elasticsearch.type`, `elasticsearch.id`,
11+
`elasticsearch.version`, `elasticsearch.shard.broadcast.total`,
12+
`elasticsearch.shard.broadcast.successful`, `elasticsearch.shard.broadcast.failed`,
13+
`elasticsearch.shard.replication.total`, `elasticsearch.shard.replication.successful`,
14+
`elasticsearch.shard.replication.failed`, `elasticsearch.response.status`,
15+
`elasticsearch.shard.bulk.id`, `elasticsearch.shard.bulk.index`,
16+
`elasticsearch.node.failures`, and `elasticsearch.node.cluster.name`.
717
type: boolean
818
default: false
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
description: >
2-
This instrumentation enables client spans for Elasticsearch transport client requests. Each call
3-
produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
2+
This instrumentation enables client spans and metrics for Elasticsearch transport client requests.
3+
Each call produces a span named after the Elasticsearch action, enriched with transport-specific
4+
attributes.
45
configurations:
56
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
6-
description: Enable the capture of experimental span attributes.
7+
description: >
8+
Enable the capture of experimental span attributes including `elasticsearch.action`,
9+
`elasticsearch.request`, `elasticsearch.request.indices`,
10+
`elasticsearch.request.search.types`, `elasticsearch.type`, `elasticsearch.id`,
11+
`elasticsearch.version`, `elasticsearch.shard.broadcast.total`,
12+
`elasticsearch.shard.broadcast.successful`, `elasticsearch.shard.broadcast.failed`,
13+
`elasticsearch.shard.replication.total`, `elasticsearch.shard.replication.successful`,
14+
`elasticsearch.shard.replication.failed`, `elasticsearch.response.status`,
15+
`elasticsearch.shard.bulk.id`, `elasticsearch.shard.bulk.index`,
16+
`elasticsearch.node.failures`, and `elasticsearch.node.cluster.name`.
717
type: boolean
818
default: false

0 commit comments

Comments
 (0)