Phoenix Testcontainers
A Testcontainers module providing PhoenixContainer, which runs Arize Phoenix, an AI observability and evaluation platform based on OpenTelemetry and OpenInference.
Dependencies
Add the module to your project.
-
Gradle
-
Maven
dependencies {
testImplementation "io.arconia:arconia-testcontainers-phoenix"
}
<dependency>
<groupId>io.arconia</groupId>
<artifactId>arconia-testcontainers-phoenix</artifactId>
<scope>test</scope>
</dependency>
Usage
var phoenix = new PhoenixContainer("arizephoenix/phoenix:latest");
phoenix.start();
Phoenix accepts traces via OTLP, with the HTTP/Protobuf protocol at getOtlpHttpUrl() and the gRPC protocol at getOtlpGrpcUrl(). The UI is available at getPhoenixUrl().
Phoenix starts without authentication and with the telemetry of its UI turned off. Override them and any other Phoenix configuration via environment variables.
var phoenix = new PhoenixContainer("arizephoenix/phoenix:latest")
.withEnv("PHOENIX_ENABLE_AUTH", "true");
Spring Boot Service Connections
With Arconia OpenTelemetry and the Spring Boot Testcontainers support (org.springframework.boot:spring-boot-testcontainers), the application sends its traces to a PhoenixContainer bean annotated with @ServiceConnection.
@TestConfiguration(proxyBeanMethods = false)
public class TestcontainersConfiguration {
@Bean
@ServiceConnection
PhoenixContainer phoenixContainer() {
return new PhoenixContainer("arizephoenix/phoenix:latest");
}
}
Phoenix accepts traces only, so turn off the export of logs and metrics by setting the arconia.otel.logs.exporter.type and arconia.otel.metrics.exporter.type properties to none.
| In Spring Boot applications, the Phoenix Dev Service runs this container with no code and sends the traces of the application to it. |