所以,我可以在我的发现服务器中使用属性management.tracing.sampling.probability。但在我的微服务类中,我无法看到或使用 yaml 文件中的属性。我已经尝试了所有可能的依赖。但我不明白我如何只能在我的发现服务器中使用和查看它。
我假设这是 Boot 3.x,如果是这样,你需要执行器和桥接器:
实现“org.springframework.boot:spring-boot-starter-actuator” 实现 'io.micrometer:micrometer-tracing-bridge-brave'
我遇到了同样的问题,但我的 Spring Boot 版本是 2.7.8 有什么建议请
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
// dependencies are
https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.20.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--
https://mvnrepository.com/artifact/io.micrometer/micrometer-observation -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
<version>1.12.5</version>
</dependency>
<!--
https://mvnrepository.com/artifact/io.micrometer/micrometer-tracing-bridge-brave -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
<version>1.2.5</version>
</dependency>
<!--
https://mvnrepository.com/artifact/io.zipkin.reporter2/zipkin-reporter-brave -->
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>