diff --git a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgent.java b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgent.java index 77ee6489832..b08598d038d 100644 --- a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgent.java +++ b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgent.java @@ -14,7 +14,7 @@ */ public final class OtlpUserAgent { - private static final String userAgent = "OTel OTLP Exporter Java/" + readVersion(); + private static final String userAgent = "OTel-OTLP-Exporter-Java/" + readVersion(); private static String readVersion() { Properties properties = new Properties(); diff --git a/exporters/otlp/common/src/test/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgentTest.java b/exporters/otlp/common/src/test/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgentTest.java index c0333a2eb05..e94174c06a2 100644 --- a/exporters/otlp/common/src/test/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgentTest.java +++ b/exporters/otlp/common/src/test/java/io/opentelemetry/exporter/internal/otlp/OtlpUserAgentTest.java @@ -14,7 +14,7 @@ class OtlpUserAgentTest { @Test void getUserAgent() { - assertThat(OtlpUserAgent.getUserAgent()).matches("OTel OTLP Exporter Java/1\\..*"); + assertThat(OtlpUserAgent.getUserAgent()).matches("OTel-OTLP-Exporter-Java/1\\..*"); } @Test @@ -27,6 +27,6 @@ void addUserAgentHeader() { valueRef.set(value); }); assertThat(keyRef.get()).isEqualTo("User-Agent"); - assertThat(valueRef.get()).matches("OTel OTLP Exporter Java/1\\..*"); + assertThat(valueRef.get()).matches("OTel-OTLP-Exporter-Java/1\\..*"); } } diff --git a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java index a009c7c61fd..6cdde874d41 100644 --- a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java +++ b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java @@ -224,7 +224,7 @@ void export() { .satisfies( req -> assertThat(req.headers().get("User-Agent")) - .matches("OTel OTLP Exporter Java/1\\..*")); + .matches("OTel-OTLP-Exporter-Java/1\\..*")); } @Test diff --git a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java index 99b3ba914a2..83dfb8721b3 100644 --- a/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java +++ b/exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractHttpTelemetryExporterTest.java @@ -248,9 +248,9 @@ void export() { assertThat(httpRequests) .singleElement() .satisfies( - req -> { - assertThat(req.headers().get("User-Agent")).matches("OTel OTLP Exporter Java/1\\..*"); - }); + req -> + assertThat(req.headers().get("User-Agent")) + .matches("OTel-OTLP-Exporter-Java/1\\..*")); } @Test