Instrumenting the producer
The producer is the component responsible for publishing messages to a broker. The publishing process itself is usually synchronous: we send a request to the broker and get a response from it indicating whether the message was published successfully.
Depending on the messaging system and producer needs, one publish request may carry one or more messages. We’ll discuss batching in the Instrumenting batching scenarios section. For now, let’s focus on a single message case.
To trace it, we need to make sure we create an activity when we publish a message, so we can track the call duration and status and debug individual requests. We’d also be interested in metrics for duration, throughput, and failure rate – it’s important to budget cloud messaging solutions or scale self-hosted brokers.
Another essential part of producer instrumentation is context propagation. Let’s stop here for a second and discuss it.
...