Microservices Sleuth基本跟踪示例在java中不起作用

Microservices Sleuth基本跟踪示例在java中不起作用,microservices,spring-cloud-sleuth,distributed-tracing,open-telemetry,opencensus,Microservices,Spring Cloud Sleuth,Distributed Tracing,Open Telemetry,Opencensus,我尝试使用sleuth otel实现跟踪。为此,我遵循了官方sleuth otel文档中提到的步骤。我创建了一个示例项目来实现这一点。但那没用。 我跟踪了这个链接 这是我的pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="htt

我尝试使用sleuth otel实现跟踪。为此,我遵循了官方sleuth otel文档中提到的步骤。我创建了一个示例项目来实现这一点。但那没用。 我跟踪了这个链接

这是我的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>2.4.4</version>
      <relativePath />
      <!-- lookup parent from repository -->
   </parent>
   <groupId>com.example</groupId>
   <artifactId>demo</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <name>demo</name>
   <description>Demo project for Spring Boot</description>
   <properties>
      <java.version>11</java.version>
      <spring-cloud.version>2020.0.2</spring-cloud.version>
   </properties>
   <dependencies>
      <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
         <version>2.4.4</version>
      </dependency>
      <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <version>2.4.4</version>
         <scope>test</scope>
      </dependency>
      <!-- Boot's Web support -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
      <!-- Boot's Web support -->
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
      <!-- Sleuth with OpenTelemetry tracer implementation -->
      <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>
            </exclusion>
         </exclusions>
      </dependency>
      <!-- This dependency adds OTel support -->
      <dependency>
         <groupId>org.springframework.cloud</groupId>
         <artifactId>spring-cloud-sleuth-otel-autoconfigure</artifactId>
         <version>1.0.0-M2</version>
      </dependency>
   </dependencies>
   <build>
      <plugins>
         <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
         </plugin>
      </plugins>
   </build>
   <!-- Spring Cloud Sleuth requires a Spring Cloud BOM -->
   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <!-- Provide the latest stable Spring Cloud release train version (e.g. 2020.0.0) -->
            <version>2020.0.0</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-otel-dependencies</artifactId>
            <!-- Provide the version of the Spring Cloud Sleuth OpenTelemetry project -->
            <version>1.0.0-M2</version>
            <scope>import</scope>
            <type>pom</type>
         </dependency>
      </dependencies>
   </dependencyManagement>
   <!-- You 'll need those to add OTel support -->
   <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>
</project>
主要是这个


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {
    private static Logger log = LoggerFactory.getLogger(DemoApplication.class);
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}
我还在application.properties中添加了这些值

spring.sleuth.otel.log.slf4j.enabled=true
spring.sleuth.otel.log.exporter.enabled=true
当通过邮递员点击url时,我得到了如下结果


我只是想知道为什么基本示例也不起作用。文件是否无效或我是否犯了任何错误。有人能帮上忙吗?

请使用最新版本的Sleuth OTel,最新版本的发布系列,不要使用opentracing。是的。我没有使用opentracing。
spring.sleuth.otel.log.slf4j.enabled=true
spring.sleuth.otel.log.exporter.enabled=true