See gh-43316
This commit is contained in:
Johnny Lim
2024-11-28 23:17:38 +09:00
committed by Stéphane Nicoll
parent a0309a5475
commit 859c235a95
11 changed files with 22 additions and 23 deletions

View File

@@ -55,19 +55,19 @@ class OpenTelemetryLoggingDockerComposeConnectionDetailsFactory
private final int grpcPort;
private final int httPort;
private final int httpPort;
private OpenTelemetryLoggingDockerComposeConnectionDetails(RunningService source) {
super(source);
this.host = source.host();
this.grpcPort = source.ports().get(OTLP_GRPC_PORT);
this.httPort = source.ports().get(OTLP_HTTP_PORT);
this.httpPort = source.ports().get(OTLP_HTTP_PORT);
}
@Override
public String getUrl(Transport transport) {
int port = switch (transport) {
case HTTP -> this.httPort;
case HTTP -> this.httpPort;
case GRPC -> this.grpcPort;
};
return "http://%s:%d/v1/logs".formatted(this.host, port);

View File

@@ -56,19 +56,19 @@ class OpenTelemetryTracingDockerComposeConnectionDetailsFactory
private final int grpcPort;
private final int httPort;
private final int httpPort;
private OpenTelemetryTracingDockerComposeConnectionDetails(RunningService source) {
super(source);
this.host = source.host();
this.grpcPort = source.ports().get(OTLP_GRPC_PORT);
this.httPort = source.ports().get(OTLP_HTTP_PORT);
this.httpPort = source.ports().get(OTLP_HTTP_PORT);
}
@Override
public String getUrl(Transport transport) {
int port = switch (transport) {
case HTTP -> this.httPort;
case HTTP -> this.httpPort;
case GRPC -> this.grpcPort;
};
return "http://%s:%d/v1/traces".formatted(this.host, port);