[英]Spring Actuator to expose /trace or /tracing endpoint for traceId spanId and parentId
關於 SpringBoot 執行器和可能的 /trace /tracing 端點的小問題。
我指的是跟蹤,如 traceId、spanId 和 parentId。
目前,執行器可以公開端點,如 /metrics 或 /prometheus 用於度量(不是跟蹤)。
雖然 SpringBoot 應用程序可以將這些指標直接“推送”到后端指標服務器,但一種流行的結構是公開 /metrics 或 /prometheus 端點,因此某種“輪詢”系統(類似於 prometheus 代理,metrics beat)可以定期調用端點,以便代理將其發送到后端指標服務器。
/trace /tracing 的一些類似結構公開了開放遙測,開放跟蹤信息在我看來可能同樣有趣。
我嘗試了什么:
我去公開執行器的 /httptrace 端點,並將 micrometer-tracing 添加到我的類路徑中,希望跟蹤信息可用。
但是,/httptrace 端點信息與跟蹤完全無關(如 traceId、spanId parentId)。
問題:執行器公開跟蹤信息的等價物是什么?請問跟蹤信息?
謝謝
我想你可以使用這個: Spring Boot Actuator 的“httptrace”端點不再存在於 Spring Boot 2.2.0
基本上作為解決方法,將此配置添加到 Spring 環境:
management.endpoints.web.exposure.include: httptrace
並像這樣提供一個 HttpTraceRepository bean:
@Configuration
// @Profile("actuator-endpoints")
// if you want: register bean only if profile is set
public class HttpTraceActuatorConfiguration {
@Bean
public HttpTraceRepository httpTraceRepository() {
return new InMemoryHttpTraceRepository();
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.