SpringCloud Spring Integration和Spring Cloud Stream
Spring Cloud Sleuth与Spring Integration集成。它为发布和订阅事件创建spans。要禁用Spring Integration检测,请将spring.sleuth.integration.enabled设置为false。
您可以提供spring.sleuth.integration.patterns模式来显式提供要包括以进行跟踪的通道的名称。默认情况下,除hystrixStreamOutput通道以外的所有通道都包括在内。
使用
Executor构建Spring IntegrationIntegrationFlow时,必须使用Executor的未跟踪版本。用TraceableExecutorService装饰Spring Integration执行器通道会导致spans被不正确地关闭。
如果要自定义从消息头读取和向消息头写入跟踪上下文的方式,就足以注册类型的beans:
Propagation.Setter<MessageHeaderAccessor, String>-用于将标头写入消息Propagation.Getter<MessageHeaderAccessor, String>-用于从邮件中读取标题