我阅读了Sleuth文档,但没有找到有关更改默认参数名称“ traceId”或“ spanId”的信息。是否可以不添加额外的字段?
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
Span currentSpan = this.tracer.currentSpan();
if (currentSpan == null) {
chain.doFilter(request, response);
return;
}
currentSpan.customizer().tag("correlationId", currentSpan.context().spanIdString());
chain.doFilter(request, response);
}
答案 0 :(得分:0)
您将必须创建自己的Propagation
bean实现。默认值为B3Propagation
。您可以在此处https://github.com/openzipkin/brave/blob/5.8.0/brave/src/main/java/brave/propagation/B3Propagation.java