Last active
February 1, 2024 12:40
-
-
Save xsreality/d8508c5ef82b05f07acb1da0485fb7dc to your computer and use it in GitHub Desktop.
Enabling tracing with Spring Cloud Sleuth and OpenTelemetry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<properties> | |
<spring-cloud.version>2021.0.0-M2</spring-cloud.version> | |
<spring-cloud-sleuth-otel.version>1.1.0-M3</spring-cloud-sleuth-otel.version> | |
<opentelemetry-exporter-otlp>1.7.0</opentelemetry-exporter-otlp> | |
<grpc-netty-shaded>1.41.0</grpc-netty-shaded> | |
</properties> | |
<dependencyManagement> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-dependencies</artifactId> | |
<version>${spring-cloud.version}</version> | |
<type>pom</type> | |
<scope>import</scope> | |
</dependency> | |
<!-- Spring Cloud Sleuth OTel requires a Spring Cloud Sleuth OTel BOM --> | |
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-sleuth-otel-dependencies</artifactId> | |
<version>${spring-cloud-sleuth-otel.version}</version> | |
<scope>import</scope> | |
<type>pom</type> | |
</dependency> | |
</dependencies> | |
</dependencyManagement> | |
<!-- Sleuth with Brave tracer implementation --> | |
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-starter-sleuth</artifactId> | |
<exclusions> | |
<!-- Exclude Brave (the default) --> | |
<exclusion> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-sleuth-brave</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<!-- Add OpenTelemetry tracer --> | |
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-sleuth-otel-autoconfigure</artifactId> | |
</dependency> | |
<!-- https://mvnrepository.com/artifact/io.opentelemetry/opentelemetry-exporter-otlp --> | |
<dependency> | |
<groupId>io.opentelemetry</groupId> | |
<artifactId>opentelemetry-exporter-otlp</artifactId> | |
<version>${opentelemetry-exporter-otlp}</version> | |
</dependency> | |
<!-- https://mvnrepository.com/artifact/io.grpc/grpc-netty --> | |
<dependency> | |
<groupId>io.grpc</groupId> | |
<artifactId>grpc-netty-shaded</artifactId> | |
<version>${grpc-netty-shaded}</version> | |
</dependency> | |
<repositories> | |
<repository> | |
<id>spring-snapshots</id> | |
<url>https://repo.spring.io/snapshot</url> | |
<snapshots> | |
<enabled>true</enabled> | |
</snapshots> | |
</repository> | |
<repository> | |
<id>spring-milestones</id> | |
<url>https://repo.spring.io/milestone</url> | |
</repository> | |
</repositories> | |
<pluginRepositories> | |
<pluginRepository> | |
<id>spring-snapshots</id> | |
<url>https://repo.spring.io/snapshot</url> | |
</pluginRepository> | |
<pluginRepository> | |
<id>spring-milestones</id> | |
<url>https://repo.spring.io/milestone</url> | |
</pluginRepository> | |
</pluginRepositories> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary: