Skip to content

Commit

Permalink
Add opentelemetry to DockerImageNames
Browse files Browse the repository at this point in the history
  • Loading branch information
eddumelendez committed Sep 13, 2023
1 parent eafa80c commit 3821162
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;
Expand Down Expand Up @@ -64,7 +65,7 @@ class OtlpContainerConnectionDetailsFactoryIntegrationTests {

@Container
@ServiceConnection
static final GenericContainer<?> container = new GenericContainer<>("otel/opentelemetry-collector-contrib:0.75.0")
static final GenericContainer<?> container = new GenericContainer<>(DockerImageNames.opentelemetry())
.withCommand("--config=/etc/" + CONFIG_FILE_NAME)
.withCopyToContainer(MountableFile.forClasspathResource(CONFIG_FILE_NAME), "/etc/" + CONFIG_FILE_NAME)
.withExposedPorts(4318, 9090);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConnectionDetails;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

Expand All @@ -42,7 +43,7 @@ class OtlpTracingContainerConnectionDetailsFactoryIntegrationTests {

@Container
@ServiceConnection
static final GenericContainer<?> container = new GenericContainer<>("otel/opentelemetry-collector-contrib:0.75.0")
static final GenericContainer<?> container = new GenericContainer<>(DockerImageNames.opentelemetry())
.withExposedPorts(4318);

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public final class DockerImageNames {

private static final String ORACLE_XE_VERSION = "18.4.0-slim";

private static final String OPENTELEMETRY_VERSION = "0.75.0";

private static final String PULSAR_VERSION = "3.1.0";

private static final String POSTGRESQL_VERSION = "14.0";
Expand Down Expand Up @@ -156,6 +158,14 @@ public static DockerImageName oracleXe() {
return DockerImageName.parse("gvenzl/oracle-xe").withTag(ORACLE_XE_VERSION);
}

/**
* Return a {@link DockerImageName} suitable for running the Oracle database.
* @return a docker image name for running the Oracle database
*/
public static DockerImageName opentelemetry() {
return DockerImageName.parse("otel/opentelemetry-collector-contrib").withTag(OPENTELEMETRY_VERSION);
}

/**
* Return a {@link DockerImageName} suitable for running Apache Pulsar.
* @return a docker image name for running pulsar
Expand Down

0 comments on commit 3821162

Please sign in to comment.