[fix](tracing) fix the issue that a trace may track multiple queries (#19804)

This commit is contained in:
luozenglin
2023-05-19 08:58:53 +08:00
committed by GitHub
parent 3e0b661267
commit 0dd361dbf7

View File

@ -573,7 +573,7 @@ public class ConnectProcessor {
case COM_QUERY:
case COM_STMT_PREPARE:
ctx.initTracer("trace");
Span rootSpan = ctx.getTracer().spanBuilder("handleQuery").startSpan();
Span rootSpan = ctx.getTracer().spanBuilder("handleQuery").setNoParent().startSpan();
try (Scope scope = rootSpan.makeCurrent()) {
handleQuery();
} catch (Exception e) {