OpenTelemetry Dev Services
Arconia Dev Services provides zero-code integrations to services your application depends on, both at development and test time, relying on the power of Testcontainers and Spring Boot. This page describes the Arconia Dev Services for OpenTelemetry.
Grafana LGTM
When your application uses OpenTelemetry for observability, you can use the Arconia OpenTelemetry Dev Service LGTM to automatically start a full Grafana observability platform based on OpenTelemetry. This enables you to visualize and explore your application’s telemetry data during development and testing.
Dependencies
First, you need to add the Arconia OpenTelemetry Dev Service LGTM dependency to your project.
dependencies {
testAndDevelopmentOnly 'io.arconia:arconia-dev-service-opentelemetry-lgtm'
}
This dependency also includes the Spring Boot DevTools, which automatically restarts your application when you make changes to your code as part of your development workflow. |
Running the Application
Unlike the lower-level Testcontainers support in Spring Boot, Arconia doesn’t require special tasks to run your application (./gradlew bootTestRun
or ./mvnw spring-boot:test-run
). You can simply use:
-
Gradle:
./gradlew bootRun
-
Maven:
./mvnw spring-boot:run
Your integration tests will automatically use the Arconia Dev Services without any additional configuration.
The application logs will show you the URL where you can access the Grafana observability platform and information about logs, metrics, and traces being exported to the platform.
...o.t.grafana.LgtmStackContainer : Access to the Grafana dashboard: http://localhost:38125
...s.l.e.o.OtlpLoggingExporterConfiguration : Configuring OpenTelemetry HTTP/Protobuf log exporter with endpoint: http://localhost:39117/v1/logs
...s.m.e.o.OtlpMetricsExporterConfiguration : Configuring OpenTelemetry HTTP/Protobuf metric exporter with endpoint: http://localhost:39117/v1/metrics
...s.t.e.o.OtlpTracingExporterConfiguration : Configuring OpenTelemetry HTTP/Protobuf span exporter with endpoint: http://localhost:39117/v1/traces
By default, logs, metrics, and traces are exported via OTLP using the HTTP/Protobuf format.
Customizing the Dev Service
You can customize the Arconia OpenTelemetry Dev Service LGTM via configuration properties, such as changing the image name or not reusing the service across multiple applications and tests.
arconia:
dev:
services:
lgtm:
image-name: grafana/otel-lgtm:0.8.6
reusable: false
Disabling the Dev Service
If you want to disable the Arconia OpenTelemetry Dev Service LGTM, you can do so via configuration properties.
arconia:
dev:
services:
lgtm:
enabled: false
You can disable the Dev Service for a specific test class or method by using the @TestProperty annotation or equivalent Spring testing utilities.
|