diff --git a/instrumentation/java-streams/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/java/inputstream/InputStreamUtils.java b/instrumentation/java-streams/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/java/inputstream/InputStreamUtils.java index 7581bab6..9fda5290 100644 --- a/instrumentation/java-streams/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/java/inputstream/InputStreamUtils.java +++ b/instrumentation/java-streams/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/java/inputstream/InputStreamUtils.java @@ -49,7 +49,9 @@ private InputStreamUtils() {} static { try { - getAttribute = Class.forName("io.opentelemetry.sdk.trace.SdkSpan").getDeclaredMethod("getAttribute", AttributeKey.class); + getAttribute = + Class.forName("io.opentelemetry.sdk.trace.SdkSpan") + .getDeclaredMethod("getAttribute", AttributeKey.class); } catch (NoSuchMethodException e) { log.error("getAttribute method not found in SdkSpan class", e); } catch (ClassNotFoundException e) { @@ -75,10 +77,12 @@ public static void addAttribute(Span span, AttributeKey attributeKey, St .setAttribute(attributeKey, value); // Also add content type if present - if (getAttribute != null && span.getClass().getName().equals("io.opentelemetry.sdk.trace.SdkSpan")) { + if (getAttribute != null + && span.getClass().getName().equals("io.opentelemetry.sdk.trace.SdkSpan")) { try { Object reqContentType = - getAttribute.invoke(span, HypertraceSemanticAttributes.HTTP_REQUEST_HEADER_CONTENT_TYPE); + getAttribute.invoke( + span, HypertraceSemanticAttributes.HTTP_REQUEST_HEADER_CONTENT_TYPE); if (reqContentType != null) { spanBuilder.setAttribute("http.request.header.content-type", (String) reqContentType); } diff --git a/instrumentation/vertx/vertx-web-3.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/ResponseBodyWrappingHandler.java b/instrumentation/vertx/vertx-web-3.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/ResponseBodyWrappingHandler.java index c00a4565..06adf1f4 100644 --- a/instrumentation/vertx/vertx-web-3.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/ResponseBodyWrappingHandler.java +++ b/instrumentation/vertx/vertx-web-3.0/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/vertx/ResponseBodyWrappingHandler.java @@ -41,7 +41,9 @@ public class ResponseBodyWrappingHandler implements Handler { static { try { - getAttribute = Class.forName("io.opentelemetry.sdk.trace.SdkSpan").getDeclaredMethod("getAttribute", AttributeKey.class); + getAttribute = + Class.forName("io.opentelemetry.sdk.trace.SdkSpan") + .getDeclaredMethod("getAttribute", AttributeKey.class); } catch (NoSuchMethodException e) { log.error("getAttribute method not found in SdkSpan class", e); } catch (ClassNotFoundException e) { @@ -73,7 +75,8 @@ public void handle(Buffer event) { .setAttribute(HypertraceSemanticAttributes.HTTP_RESPONSE_BODY, responseBody); // Also add content type if present - if (getAttribute != null && span.getClass().getName().equals("io.opentelemetry.sdk.trace.SdkSpan")) { + if (getAttribute != null + && span.getClass().getName().equals("io.opentelemetry.sdk.trace.SdkSpan")) { try { Object resContentType = getAttribute.invoke(