Open Telemetry Setup
Add the following dependencies into your application:
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-opentelemetry</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-otlp</artifactId>
</dependency>
And update configuration:
application.yaml
spring:
application:
name: <name of service>
management:
tracing:
sampling:
probability: 1
opentelemetry:
tracing:
export:
otlp:
endpoint: http://<my-endpoint>:4318/v1/traces
In Spring app, disable the 'metric' export (we are currently only using 'traces') in a suitable @Configuration, for example AppManifest:
AppManifest.java
@Bean
OtlpConfig otlpConfig() {
return new OtlpConfig() {
@Override public @Nullable String get(final String key) { return null;}
@Override public boolean enabled() { return false; }
};
}
Run up Jaeger as a telemetry collector:
+
Docker - one of many options is to use Jaeger as telemetry collector
docker run -d --name jaeger \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 5778:5778 \
-p 9411:9411 \
cr.jaegertracing.io/jaegertracing/jaeger
This will expose Jaeger’s UI at http://<my-endpoint>:16686