spring-cloud-sleuth
.
我的问题涉及errorChannel流/绑定。我没有用
error
this
). 相反,我有一个流设置来监听errorChannel,它在消息中添加一个额外的头,然后将其发送到错误目的地。它看起来与下面类似(用Groovy编写):
IntegrationFlows
.from('errorChannel')
.log()
.handle(MessagingException, {e, h ->
def message = MessageBuilder.withPayload(e).copyHeaders(h).setHeader('name', 'myApp').build()
errorSource.channel().send(message)
.channel('nullChannel')
.get()
在哪里?
errorSource
的通道声明为
@Output
.
日志行输出类似于:
INFO [myApp,1234,4321,false] LoggingHandler: ErrorMessage [...]
但是,当我从错误目的地收到消息时
X-B3-ParentSpanId
头与上面日志消息中的span id(4321值)或源应用程序中记录的任何其他span id不匹配。
我唯一能看到匹配的方法就是
org.springframework.cloud
直到调试,即使这样,它还是来自
TracingChannelInterceptor
(尽管这个实例看起来属于errorChannel的拦截器列表,所以我觉得我很接近了)。我不想让DEBUG继续工作,因为它显然变得很吵。
X-B3-父级ID
头球?其目的是获取该span id并将其保存,以便稍后在检查日志时可以使用它直接转到源应用程序。