diff --git a/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/restclient/OpenTelemetryClientFilter.java b/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/restclient/OpenTelemetryClientFilter.java index 0289b381e5e29..a19529aeb8333 100644 --- a/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/restclient/OpenTelemetryClientFilter.java +++ b/extensions/opentelemetry/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/tracing/restclient/OpenTelemetryClientFilter.java @@ -130,17 +130,19 @@ public void set(final ClientRequestContext carrier, final String key, final Stri private static class ClientSpanNameExtractor implements SpanNameExtractor { @Override public String extract(final ClientRequestContext request) { - String pathTemplate = (String) request.getProperty("UrlPathTemplate"); - if (pathTemplate != null && pathTemplate.length() > 1) { - return pathTemplate; + StringBuilder name = new StringBuilder("HTTP"); + + String method = request.getMethod(); + if (method != null && method.length() > 1) { + name.append(" ").append(method); } - String uriPath = request.getUri().getPath(); - if (uriPath != null && uriPath.length() > 1) { - return uriPath; + String pathTemplate = (String) request.getProperty("UrlPathTemplate"); + if (pathTemplate != null && pathTemplate.length() > 1) { + name.append(" ").append(pathTemplate); } - return "HTTP " + request.getMethod(); + return name.toString(); } }