OpenLIT Testcontainers
A Testcontainers module providing OpenLitContainer, which runs OpenLIT, an AI engineering platform based on OpenTelemetry, together with the ClickHouse database it stores the telemetry in.
Dependencies
Add the module to your project.
-
Gradle
-
Maven
dependencies {
testImplementation "io.arconia:arconia-testcontainers-openlit"
}
<dependency>
<groupId>io.arconia</groupId>
<artifactId>arconia-testcontainers-openlit</artifactId>
<scope>test</scope>
</dependency>
Usage
var openLit = new OpenLitContainer(DockerImageName.parse("ghcr.io/openlit/openlit:latest"));
openLit.start();
OpenLIT accepts logs, metrics, and traces via OTLP, with the HTTP/Protobuf protocol at getOtlpHttpUrl() and the gRPC protocol at getOtlpGrpcUrl(). The container requires OpenLIT 2.1.1 or later, which receives OTLP data with its built-in receiver.
The UI is available at getOpenLitUrl(), where you’re signed in automatically with the demo account created by OpenLIT: user@openlit.io (email) and openlituser (password). OpenLIT restricts a few operations for the demo account, such as changing the database configuration. To sign in yourself instead, set the DEMO_ACCOUNT_EMAIL environment variable to an empty value.
var openLit = new OpenLitContainer(DockerImageName.parse("ghcr.io/openlit/openlit:latest"))
.withEnv("DEMO_ACCOUNT_EMAIL", "");
The ClickHouse container starts before OpenLIT and stops together with it. Set its image via withClickHouseImage().
var openLit = new OpenLitContainer(DockerImageName.parse("ghcr.io/openlit/openlit:latest"))
.withClickHouseImage("clickhouse/clickhouse-server:latest");
OpenLIT and ClickHouse join the network set via withNetwork(). Otherwise, the container creates a network for them and removes it when it stops.
| In Spring Boot applications, the OpenLIT Dev Service runs this container with no code and sends the telemetry of the application to it. |