-
Notifications
You must be signed in to change notification settings - Fork 320
Open
Labels
comp: context propagationTrace context propagationTrace context propagationtype: bugBug report and fixBug report and fix
Description
Problem
I have a Micronaut-based microservice on micronaut 4 and java 21. It is not sending traces to Datadog when used with virtual threads, but is able to send traces when used with event loops. Basically tracing is not working with changing the @ExecuteOn(TaskExecutors.IO) annotation to @ExecuteOn(TaskExecutors.BLOCKING) on controller.
I was trying to debug in local and using latest dd agent, I could see that the span is not created when the controller method is executed with virtual threads.
Used below block in my controller to fetch trace_id.
Tracer tracer = GlobalTracer.get();
Span currentSpan = tracer.activeSpan();
if (currentSpan != null) {
// Retrieve the trace ID
String traceId = currentSpan.context().toTraceId();
// Use the trace ID as needed
log.info("dd.trace_id=" + traceId);
} else {
log.info("No active span found.");
}
ketola, showmeyourcode, amelentyev, SerCeMan, artpaym and 1 more
Metadata
Metadata
Assignees
Labels
comp: context propagationTrace context propagationTrace context propagationtype: bugBug report and fixBug report and fix