diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpExporterUtil.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpExporterUtil.java index 6621c40adf..151862501b 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpExporterUtil.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpExporterUtil.java @@ -58,15 +58,15 @@ class OtlpExporterUtil { String endpoint = signalProperties.getEndpoint(); if (endpoint == null) { endpoint = properties.getEndpoint(); - } - if (endpoint != null) { - if (isHttpProtobuf) { + if (endpoint != null && isHttpProtobuf) { if (!endpoint.endsWith("/")) { endpoint += "/"; } endpoint += signalPath(dataType); } + } + if (endpoint != null) { if (isHttpProtobuf) { setHttpEndpoint.accept(httpBuilder, endpoint); } else {