简体   繁体   English

如何在 SQS 中发送和使用 sleuth traceId

[英]How to send and consume sleuth traceId in SQS

I'm using spring-cloud-sleuth.version:3.0.4 and spring-cloud-aws-messaging:2.2.6.RELEASE我正在使用spring-cloud-sleuth.version:3.0.4spring-cloud-aws-messaging:2.2.6.RELEASE

It correctly propogates trace id with HTTP requests.它使用 HTTP 请求正确传播跟踪 ID。

However, it seems that it doesn't work with SQS.但是,它似乎不适用于 SQS。

Is there any way to automatically send and consume sleuth traceId with SQS communication.有没有办法通过 SQS 通信自动发送和使用 sleuth traceId。

Spring Cloud AWS is now a community project, see: https://awspring.io/ The current release train of Spring Cloud (2020.x), where you can find Sleuth 3.x does not include/support it. Spring Cloud AWS 现在是一个社区项目,请参见: https://awspring.io/ Spring Cloud Sleuth (2020.x) 的当前发布序列,不包含/可以找到它。

You should use io.awspring.cloud:spring-cloud-aws-messaging:2.3.x instead of org.springframework.cloud:spring-cloud-aws-messaging:2.2.x with the current release train of Spring Cloud (2020.x).您应该使用io.awspring.cloud:spring-cloud-aws-messaging:2.3.x而不是org.springframework.cloud:spring-cloud-aws-messaging:2.2.x与 Spring Cloud (2020. X)。

Because of these, Sleuth does not instrument Spring AWS Messaging directly but if you can use SQS in a way that integrates with Spring Integration/Messaging/Stream/something that is already instrumented, this could work;因此,Sleuth 不会直接检测 Spring AWS 消息传递,但如果您可以以与 Spring 集成/消息传递/流/已经检测的东西集成的方式使用 SQS,这可以工作; ie: I would try using QueueMessageChannel and the annotations, I don't think QueueMessagingTemplate will work.即:我会尝试使用QueueMessageChannel和注释,我认为QueueMessagingTemplate不会起作用。

Another thing you can do is manually instrument it and propagate tracing information in the headers, see: TraceSpringMessagingAutoConfiguration您可以做的另一件事是手动检测它并在标头中传播跟踪信息,请参阅: TraceSpringMessagingAutoConfiguration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM