fix tracing span instrument
@@ -24,6 +24,7 @@ use common_exception::ToErrorCode;
use common_io::prelude::*;
use common_planners::PlanNode;
use common_tracing::tracing;
+use common_tracing::tracing::Instrument;
use metrics::histogram;
use msql_srv::AsyncMysqlShim;
use msql_srv::ErrorKind;
@@ -312,7 +313,8 @@ impl<W: std::io::Write> InteractiveWorkerBase<W> {
let instant = Instant::now();
let interpreter = InterpreterFactory::get(context.clone(), plan?)?;
- let query_result = context.try_spawn(async move {
+ let query_result = context.try_spawn(
+ async move {
// Write start query log.
let _ = interpreter
.start()
@@ -333,7 +335,9 @@ impl<W: std::io::Write> InteractiveWorkerBase<W> {
.map_err(|e| tracing::error!("interpreter.finish.error: {:?}", e));
Ok::<Vec<DataBlock>, ErrorCode>(query_result)
- })?;
+ }
+ .in_current_span(),
+ )?;
let query_result = query_result
.await
