Support Otlp Tracing's GRPC port from service connections

Otlp Tracing's exporter is configured using Transport. Current support
for service connections read the mapped port for HTTP transport 4318.
This commits adds support to read port for GRPC transport 4317.

See gh-41333
This commit is contained in:
Eddú Meléndez
2024-07-05 09:43:41 -06:00
committed by Moritz Halbritter
parent f6505f7a18
commit 7baa553760
7 changed files with 51 additions and 10 deletions

View File

@@ -43,13 +43,16 @@ class OpenTelemetryTracingContainerConnectionDetailsFactoryIntegrationTests {
@Container
@ServiceConnection
static final GenericContainer<?> container = TestImage.OPENTELEMETRY.genericContainer().withExposedPorts(4318);
static final GenericContainer<?> container = TestImage.OPENTELEMETRY.genericContainer()
.withExposedPorts(4317, 4318);
@Autowired
private OtlpTracingConnectionDetails connectionDetails;
@Test
void connectionCanBeMadeToOpenTelemetryContainer() {
assertThat(this.connectionDetails.getGrpcEndpoint())
.isEqualTo("http://" + container.getHost() + ":" + container.getMappedPort(4317) + "/v1/traces");
assertThat(this.connectionDetails.getUrl())
.isEqualTo("http://" + container.getHost() + ":" + container.getMappedPort(4318) + "/v1/traces");
}