[英]Spring Actuator to expose /trace or /tracing endpoint for traceId spanId and parentId
Small question regarding SpringBoot actuator and a possible /trace /tracing endpoint please.关于 SpringBoot 执行器和可能的 /trace /tracing 端点的小问题。
I am referring to tracing, as in traceId, spanId and parentId please.我指的是跟踪,如 traceId、spanId 和 parentId。
Currently, actuator can expose endpoints like /metrics or /prometheus for metrics (which are not traces).目前,执行器可以公开端点,如 /metrics 或 /prometheus 用于度量(不是跟踪)。
While SpringBoot apps can send, "push" those metrics directly to a backend metrics server, a popular construct is to expose the /metrics or /prometheus endpoint, so some sort of "poll" system (similar to prometheus agent, metrics beat) which can periodically call the endpoint so the agent will then send it to the backend metrics server.虽然 SpringBoot 应用程序可以将这些指标直接“推送”到后端指标服务器,但一种流行的结构是公开 /metrics 或 /prometheus 端点,因此某种“轮询”系统(类似于 prometheus 代理,metrics beat)可以定期调用端点,以便代理将其发送到后端指标服务器。
Some similar construct for /trace /tracing to expose open telemetry, open tracing information can be equality as interesting in my opinion. /trace /tracing 的一些类似结构公开了开放遥测,开放跟踪信息在我看来可能同样有趣。
What I tried:我尝试了什么:
I went to expose the /httptrace endpoint from actuator, and added micrometer-tracing to my classpath, hoping trace information would be available.我去公开执行器的 /httptrace 端点,并将 micrometer-tracing 添加到我的类路径中,希望跟踪信息可用。
However, the /httptrace endpoint information is not related at all to traces (as in traceId, spanId parentId).但是,/httptrace 端点信息与跟踪完全无关(如 traceId、spanId parentId)。
Question: what is the equivalent in order for actuator to expose trace, tracing information please?问题:执行器公开跟踪信息的等价物是什么?请问跟踪信息?
Thank you谢谢
I think you can use this: "httptrace" endpoint of Spring Boot Actuator doesn't exist anymore with Spring Boot 2.2.0我想你可以使用这个: Spring Boot Actuator 的“httptrace”端点不再存在于 Spring Boot 2.2.0
Basically as a workaround, add this configuration to the Spring environment:基本上作为解决方法,将此配置添加到 Spring 环境:
management.endpoints.web.exposure.include: httptrace
and provide an HttpTraceRepository bean like this:并像这样提供一个 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.