如何使用springboot3/micrometer排除一些要观察的uri

far*_*rid 9 spring-boot micrometer-tracing

海伊

我正在使用 springboot 3 和新的千分尺观察。有没有办法防止为某些路径(如 /actuator/prometheus)生成trace_id/span_id?观察为每次调用 /actuator/* 添加跟踪 ID。

谢谢

小智 0

您需要提供有关问题的更多信息,但我认为您已在 application.propeties 中设置了这一行,例如:

management.endpoints.web.exposure.include=/actuator/*
Run Code Online (Sandbox Code Playgroud)

但存在如下选项:

management.endpoints.web.exposure.exclude=/actuator/prometheus
Run Code Online (Sandbox Code Playgroud)