Skip to content

Commit a7663d1

Browse files
committed
remove unused OpenSearchJavaResponse.java
1 parent 4ed0def commit a7663d1

File tree

6 files changed

+8
-37
lines changed

6 files changed

+8
-37
lines changed

instrumentation/opensearch/opensearch-java-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/java/v3_0/OpenSearchJavaAttributesGetter.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55

66
package io.opentelemetry.javaagent.instrumentation.opensearch.java.v3_0;
77

8-
import static io.opentelemetry.instrumentation.api.incubator.semconv.db.internal.DbResponseStatusUtil.dbResponseStatusCode;
9-
108
import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientAttributesGetter;
119
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
1210
import javax.annotation.Nullable;
1311

1412
final class OpenSearchJavaAttributesGetter
15-
implements DbClientAttributesGetter<OpenSearchJavaRequest, OpenSearchJavaResponse> {
13+
implements DbClientAttributesGetter<OpenSearchJavaRequest, Void> {
1614

1715
@SuppressWarnings("deprecation") // using deprecated DbSystemIncubatingValues
1816
@Override
@@ -54,8 +52,7 @@ public String getDbOperationName(OpenSearchJavaRequest request) {
5452

5553
@Nullable
5654
@Override
57-
public String getResponseStatus(
58-
@Nullable OpenSearchJavaResponse response, @Nullable Throwable error) {
59-
return response != null ? dbResponseStatusCode(response.getStatusCode()) : null;
55+
public String getResponseStatus(@Nullable Void response, @Nullable Throwable error) {
56+
return null; // Response status is handled by HTTP instrumentation
6057
}
6158
}

instrumentation/opensearch/opensearch-java-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/java/v3_0/OpenSearchJavaInstrumenterFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414

1515
public final class OpenSearchJavaInstrumenterFactory {
1616

17-
public static Instrumenter<OpenSearchJavaRequest, OpenSearchJavaResponse> create(
18-
String instrumentationName) {
17+
public static Instrumenter<OpenSearchJavaRequest, Void> create(String instrumentationName) {
1918
OpenSearchJavaAttributesGetter dbClientAttributesGetter = new OpenSearchJavaAttributesGetter();
2019

21-
return Instrumenter.<OpenSearchJavaRequest, OpenSearchJavaResponse>builder(
20+
return Instrumenter.<OpenSearchJavaRequest, Void>builder(
2221
GlobalOpenTelemetry.get(),
2322
instrumentationName,
2423
DbClientSpanNameExtractor.create(dbClientAttributesGetter))

instrumentation/opensearch/opensearch-java-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/java/v3_0/OpenSearchJavaNetResponseAttributesGetter.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

instrumentation/opensearch/opensearch-java-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/java/v3_0/OpenSearchJavaResponse.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

instrumentation/opensearch/opensearch-java-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/java/v3_0/OpenSearchJavaResponseHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public OpenSearchJavaResponseHandler(Context context, OpenSearchJavaRequest otel
1919

2020
@Override
2121
public void accept(Object response, Throwable error) {
22-
// In OpenSearch responses, there's no information available, so the span is closed with null.
22+
// OpenSearch responses don't provide response information, so the span is closed with null.
2323
OpenSearchJavaSingletons.instrumenter().end(context, otelRequest, null, error);
2424
}
2525
}

instrumentation/opensearch/opensearch-java-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opensearch/java/v3_0/OpenSearchJavaSingletons.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
99

1010
public final class OpenSearchJavaSingletons {
11-
private static final Instrumenter<OpenSearchJavaRequest, OpenSearchJavaResponse> INSTRUMENTER =
11+
private static final Instrumenter<OpenSearchJavaRequest, Void> INSTRUMENTER =
1212
OpenSearchJavaInstrumenterFactory.create("io.opentelemetry.opensearch-java-3.0");
1313

14-
public static Instrumenter<OpenSearchJavaRequest, OpenSearchJavaResponse> instrumenter() {
14+
public static Instrumenter<OpenSearchJavaRequest, Void> instrumenter() {
1515
return INSTRUMENTER;
1616
}
1717

0 commit comments

Comments
 (0)