Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace OTLP User-Agent spaces with dashes #5080

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\\..*");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down