使用 Go 的 Azure ServiceBus 队列的 OpenTelemetry 传播问题
我有三个服务,它们订阅并发布到天蓝色服务总线上的单独队列。我刚刚为这些服务添加了开放遥测,但它似乎并未在服务之间传播跟踪 ID。
例如,单个跟踪理想地包括服务之间的流:
服务 1 -> 服务 2。队列1 ->服务2->队列2 ->服务 3
看起来我应该在服务之间注入/提取此信息,但关于如何执行此操作的文档/示例似乎有限,因为显然它应该使用 W3C 跟踪上下文“正常工作”?
如果有人能够提供任何见解或指示,告诉我应该做什么才能达到预期的结果,我将不胜感激。
非常感谢。
I have three services which subscribe and publish to separate queues on azure service bus. I've just added open telemetry for these services and it doesn't appear to propagate the trace ID between services.
For example, a single trace would ideally include the flow between services:
Service 1 -> Queue1 -> Service 2 -> Queue2 -> Service 3
It looks like I'm supposed to Inject/Extract this information between services, but there appears to be limited documentation/examples on how to do this, because apparently it's supposed to "just work" using the W3C Trace Context?
If anyone can provide any insight or pointers into exactly what I should be doing in order to achieve the desired outcome, that would be greatly appreciated.
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我记得当我需要在多个 GRPC 服务之间传播跟踪时,我对 OpenCensus 跟踪库做了类似的事情。我获取现有的跟踪范围,将其馈送到 Binary 函数,获取字节,将其设置为传出上下文中的数据,然后在接收端,我从传入上下文中提取跟踪范围并将其馈送到trace.StartSpanWithRemoteParent。
这是向上下文添加跟踪的 util 的实现:
它在接收端的外观:
希望这能为您指明正确的方向。
I remember doing something similar with OpenCensus trace library when I needed to propagate traces between multiple GRPC services. I took the existing trace span, fed it to Binary function, got the bytes, set it as data on the outgoing context, then on the receiving side I extracted the trace span from the incoming context and fed it to trace.StartSpanWithRemoteParent.
This is the implementation of the util that was adding trace to context:
How it looked on the receiving side:
Hope this points you in the right direction.