From 5b3269ba499a8f5d6b8c7d8f5b71edb9a4815c73 Mon Sep 17 00:00:00 2001 From: Theodor Mihalache Date: Sun, 24 Jul 2022 10:40:08 +0300 Subject: [PATCH] OpenTelemetry: NPE in HttpInstrumenterVertxTracer.RouteGetter when request got cancelled Refactor following code review Signed-off-by: Theodor Mihalache --- .../runtime/tracing/vertx/HttpInstrumenterVertxTracer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/HttpInstrumenterVertxTracer.java b/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/HttpInstrumenterVertxTracer.java index eb09123fb61bbd..cbc01516f969e1 100644 --- a/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/HttpInstrumenterVertxTracer.java +++ b/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/vertx/HttpInstrumenterVertxTracer.java @@ -232,12 +232,12 @@ public Long requestContentLengthUncompressed(final HttpRequest request, final Ht @Override public Integer statusCode(final HttpRequest request, final HttpResponse response) { - return response != null ? response.statusCode() : 499; + return response != null ? response.statusCode() : null; } @Override public Long responseContentLength(final HttpRequest request, final HttpResponse response) { - return response != null ? getContentLength(response.headers()) : 0; + return response != null ? getContentLength(response.headers()) : null; } @Override