Polish "Add service connection from Opentelemetry Collector for Logging"
See gh-41324
This commit is contained in:
parent
7adf843bfd
commit
8fc1bca56c
|
@ -35,7 +35,7 @@ public class OtlpLoggingProperties {
|
|||
/**
|
||||
* URL to the OTel collector's HTTP API.
|
||||
*/
|
||||
private String endpoint = "http://localhost:4318/v1/logs";
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* Call timeout for the OTel Collector to process an exported batch of data. This
|
||||
|
|
|
@ -32,7 +32,7 @@ class OpenTelemetryLoggingDockerComposeConnectionDetailsFactoryIntegrationTests
|
|||
|
||||
@DockerComposeTest(composeFile = "otlp-compose.yaml", image = TestImage.OPENTELEMETRY)
|
||||
void runCreatesConnectionDetails(OtlpLoggingConnectionDetails connectionDetails) {
|
||||
assertThat(connectionDetails.getEndpoint()).startsWith("http://").endsWith("/v1/logs");
|
||||
assertThat(connectionDetails.getUrl()).startsWith("http://").endsWith("/v1/logs");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class OpenTelemetryLoggingDockerComposeConnectionDetailsFactory
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getEndpoint() {
|
||||
public String getUrl() {
|
||||
return "http://%s:%d/v1/logs".formatted(this.host, this.port);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class OpenTelemetryLoggingContainerConnectionDetailsFactoryIntegrationTests {
|
|||
|
||||
@Test
|
||||
void connectionCanBeMadeToOpenTelemetryContainer() {
|
||||
assertThat(this.connectionDetails.getEndpoint())
|
||||
assertThat(this.connectionDetails.getUrl())
|
||||
.isEqualTo("http://" + container.getHost() + ":" + container.getMappedPort(4318) + "/v1/logs");
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class OpenTelemetryLoggingContainerConnectionDetailsFactory
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getEndpoint() {
|
||||
public String getUrl() {
|
||||
return "http://%s:%d/v1/logs".formatted(getContainer().getHost(), getContainer().getMappedPort(4318));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue