Reactor Java trace and span IDs are 0
The given function is called from a consume function (Azure Service Bus consumer function). Adding the @Trace annotation will create a new trace, can be seen from APM view, but the logs are not connected to it. Also logs from inside the reactive flow has trace and span ID's as 0.
Is there any way to tell the Datadog Agent to connect the logs from the reactive flow as well?
@Trace
private Mono<Void> process(Message<String> message)
log.info("message {}", message); // THIS will have a trace and span ID
return service
.doSomething(message)
.flatMap(data -> {
log.info("{}", data); // Trace and span ID's will be 0;
}).then();
}
Some additional notes:
Environment: Java service running in Docker (with Datadog agent), deployed to Kubernetes. HTTP requests are tracked properly. We are facing this issues with the consumed events.
Setting MDC does not solve the issue ( https://docs.datadoghq.com/tracing/connect_logs_and_traces/java/?tab=slf4jandlogback#manually-inject-trace-and-span-ids ).