0

I have 2 services which are exchanging events via Kafka. First service packs necessary tracing info (headers which are set by brave: traceId, spanId and so on) right in message payload. Consumer of the second service retrieve this information and create appropriate consumer span. I can see the whole tracing including both services in Zipkin. But I can't see appropriate tracing information in logs on consumer side. On the producer side all is ok.

The code of consumer side (as the tracings are sending to zipkin I think the most of configuration is ok, but the tracing information just don't propagate to log context...):

OrderSubmittedEvent event = message.getOrderSubmittedEvent();
logger.info("Received OrderSubmittedEvent" + event);

TraceContext.Extractor<Object> extractor = tracing.propagation()
        .extractor((c, key) -> message.getPropertiesMap().get(key));

Span oneWayReceive = tracer.nextSpan(extractor.extract(message))
        .name("process-request")
        .kind(CONSUMER);
oneWayReceive.start().flush();

What can you advice? Maybe I should attach something else but it seems like it is pretty much the only code I have around sleuth and brave.

0 Answers0