'How to propagate context between two services communicating via rabbitmq in opentelemetry?
I am trying to find a way to propagate context between two services communicating via rabbitmq in opentelemetry. There was an article for doing similar in Go article link but unable to implement it in node.
There are two approaches I am considering
- Pass context in header of message published via broker. Or
- Create a child span based on the traceId and spanId. answer link there's an answer for this in Go, but couldn't find a way to create a new span.
Is there any code reference available to perform any of the above?
Solution 1:[1]
Opentelemetry Node already has plugin for the amqp lib which already does the work for you i.e inject/extract context https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-amqplib.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Srikanth Chekuri |