领先一步
VMware 提供培训和认证,助您快速提升技能。
了解更多我代表社区很高兴地宣布 Spring Cloud Sletuh OTel 1.1.0 项目已发布。该版本可在 Maven Central 中找到。您可以查看 参考文档以了解更多信息。
Spring Cloud Sleuth OTel 是 Spring Cloud Sleuth 的一个扩展项目,它带有一个 OpenTelemetry 追踪器。
与往常一样,我们欢迎您在 GitHub、Gitter、Stack Overflow 或 Twitter 上提供反馈。
要使用 Maven 和 BOM(仅依赖管理)开始
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2021.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-otel-dependencies</artifactId>
<version>1.1.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-brave</artifactId> <!-- We want to exclude the default tracer coming from Sleuth... -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-otel-autoconfigure</artifactId> <!-- ... and we want to include the one coming from Spring Cloud Sleuth OTel -->
</dependency>
</dependencies>
或使用 Gradle
buildscript {
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE"
}
}
apply plugin: "io.spring.dependency-management"
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2021.0.4'
mavenBom 'org.springframework.cloud:spring-cloud-sleuth-otel-dependencies:1.1.0'
}
}
dependencies {
implementation('org.springframework.cloud:spring-cloud-starter-sleuth') {
exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave' // We want to exclude the default tracer coming from Sleuth...
}
implementation 'org.springframework.cloud:spring-cloud-sleuth-otel-autoconfigure' // ... and we want to include the one coming from Spring Cloud Sleuth OTel
}