Hi, I was attempting to do span.setBaggageItem("foo", "bar") in an extended decorator but noticed the header was not sent in the amqp message.
I see in the code this wouldn't work because of the ordering in doBefore (the tracer.inject happens before the spanDecorator.onSend is invoked).
private Message doBefore(String exchange, String routingKey, Object message) {
Message convertedMessage = convertMessageIfNecessary(message);
final MessageProperties messageProperties = convertedMessage.getMessageProperties();
// Add tracing header to outgoing AMQP message
// so that new spans created on the AMQP message consumer side could be associated with span of current trace
scope = RabbitMqTracingUtils.buildSendSpan(tracer, messageProperties);
tracer.inject(
scope.span().context(),
Format.Builtin.TEXT_MAP,
new RabbitMqInjectAdapter(messageProperties));
// Add AMQP related tags to tracing span
spanDecorator.onSend(messageProperties, exchange, routingKey, scope.span());
Is this intentional - and have I missed something?
Hi, I was attempting to do
span.setBaggageItem("foo", "bar")
in an extended decorator but noticed the header was not sent in the amqp message.I see in the code this wouldn't work because of the ordering in
doBefore
(thetracer.inject
happens before thespanDecorator.onSend
is invoked).Is this intentional - and have I missed something?
Any help appreciated. Thanks.