Enable Armeria server instrumentation notFound() test
RENAME
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/ArmeriaNetClientAttributesExtractor.java
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaNetClientAttributesExtractor.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.armeria.v1_3.internal;
+package io.opentelemetry.instrumentation.armeria.v1_3;
import com.linecorp.armeria.common.RequestContext;
import com.linecorp.armeria.common.logging.RequestLog;
@@ -13,7 +13,7 @@ import java.net.InetSocketAddress;
import java.net.SocketAddress;
import javax.annotation.Nullable;
-public final class ArmeriaNetClientAttributesExtractor
+final class ArmeriaNetClientAttributesExtractor
extends InetSocketAddressNetClientAttributesExtractor<RequestContext, RequestLog> {
@Override

RENAME
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/ArmeriaNetServerAttributesExtractor.java
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaNetServerAttributesExtractor.java
* SPDX-License-Identifier: Apache-2.0
*/
-package io.opentelemetry.instrumentation.armeria.v1_3.internal;
+package io.opentelemetry.instrumentation.armeria.v1_3;
import com.linecorp.armeria.common.RequestContext;
import com.linecorp.armeria.common.logging.RequestLog;
@@ -13,7 +13,7 @@ import java.net.InetSocketAddress;
import java.net.SocketAddress;
import javax.annotation.Nullable;
-public final class ArmeriaNetServerAttributesExtractor
+final class ArmeriaNetServerAttributesExtractor
extends InetSocketAddressNetServerAttributesExtractor<RequestContext, RequestLog> {
@Override

MODIFY
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracingBuilder.java
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracingBuilder.java
@@ -21,8 +21,6 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientMetrics;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerMetrics;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor;
-import io.opentelemetry.instrumentation.armeria.v1_3.internal.ArmeriaNetClientAttributesExtractor;
-import io.opentelemetry.instrumentation.armeria.v1_3.internal.ArmeriaNetServerAttributesExtractor;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.util.ArrayList;
import java.util.List;

MODIFY
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/OpenTelemetryService.java
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/OpenTelemetryService.java
@@ -7,7 +7,6 @@ package io.opentelemetry.instrumentation.armeria.v1_3;
import com.linecorp.armeria.common.HttpRequest;
import com.linecorp.armeria.common.HttpResponse;
-import com.linecorp.armeria.common.HttpStatus;
import com.linecorp.armeria.common.logging.RequestLog;
import com.linecorp.armeria.server.HttpService;
import com.linecorp.armeria.server.ServiceRequestContext;
@@ -36,15 +35,7 @@ final class OpenTelemetryService extends SimpleDecoratingHttpService {
if (span.isRecording()) {
ctx.log()
.whenComplete()
- .thenAccept(
- log -> {
- if (log.responseHeaders().status().equals(HttpStatus.NOT_FOUND)) {
- // Assume a not-found request was not served. The route we use by default will be
- // some fallback like `/*` which is not as useful as the requested path.
- span.updateName(ctx.path());
- }
- instrumenter.end(context, ctx, log, log.responseCause());
- });
+ .thenAccept(log -> instrumenter.end(context, ctx, log, log.responseCause()));
}
try (Scope ignored = context.makeCurrent()) {

MODIFY
instrumentation/armeria-1.3/testing/src/main/groovy/io/opentelemetry/instrumentation/armeria/v1_3/AbstractArmeriaHttpServerTest.groovy
instrumentation/armeria-1.3/testing/src/main/groovy/io/opentelemetry/instrumentation/armeria/v1_3/AbstractArmeriaHttpServerTest.groovy
@@ -50,12 +50,6 @@ abstract class AbstractArmeriaHttpServerTest extends HttpServerTest<Server> {
]
}
- @Override
- boolean testNotFound() {
- // currently span name is /notFound which indicates it won't be low-cardinality
- false
- }
-
@Override
Server startServer(int port) {
ServerBuilder sb = Server.builder()

Enable Armeria server instrumentation notFound() test (#4842)