如何强制侦探不在单个 b3 标头中发送 [英] how to force sleuth not send in single b3 header

查看:46
本文介绍了如何强制侦探不在单个 b3 标头中发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Spring Boot 应用程序中使用 sleuth 进行日志跟踪,我的应用程序还通过 Active MQ 发送一些消息,但是当我看到消息属性时,它发送带有单个 b3 标头的跟踪.我如何配置侦探来分隔标题?

I'm using sleuth in my Spring Boot application for log tracing, and my application also send some messages via Active MQ, but when i see the message properties, it send the trace with a single b3 header. how can i configure sleuth to separate the headers?

推荐答案

默认不仅性能更好,而且不违反 JMS 标头名称规则.我建议您弄清楚为什么不能使用 b3 single.

The default is not only better performance, but doesn't violate JMS header name rules. I would advise you figure out why you cannot use b3 single.

如果你必须使用多个标题,你可以这样做:

If you must use multiple headers, you can do something like this:

@Bean Propagation.Factory customPropagationFactory() {
  return B3Propagation.newFactoryBuilder()
      .injectFormat(Span.Kind.PRODUCER, Format.MULTI)
      .injectFormat(Span.Kind.CONSUMER, Format.MULTI)
      .build();
}

这篇关于如何强制侦探不在单个 b3 标头中发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆