Skip to content

Commit

Permalink
refactor: replace minstant/minitrace with tokio instant/tracing (#10302)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxa21 authored Jun 13, 2023
1 parent 9177034 commit 2b2950d
Show file tree
Hide file tree
Showing 28 changed files with 224 additions and 459 deletions.
196 changes: 0 additions & 196 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/batch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ futures-async-stream = { workspace = true }
hashbrown = { workspace = true }
hytra = "0.1.2"
itertools = "0.10"
minitrace = "0.4"
num-traits = "0.2"
parking_lot = { version = "0.12", features = ["arc_lock"] }
paste = "1"
Expand Down
11 changes: 2 additions & 9 deletions src/batch/src/executor/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

use async_stream::stream;
use futures::stream::StreamExt;
use minitrace::prelude::*;
use risingwave_common::catalog::Schema;
use risingwave_common::error::ErrorCode;
use tokio::select;
use tokio::sync::watch::Receiver;

use crate::executor::{BoxedDataChunkStream, BoxedExecutor, Executor};
use crate::task::ShutdownMsg;
use crate::tracing::Instrument;

/// `ManagerExecutor` build on top of the underlying executor. For now, it do two things:
/// 1. the duration of performance-critical operations will be traced, such as open/next/close.
Expand Down Expand Up @@ -62,13 +62,6 @@ impl Executor for ManagedExecutor {
let span_name = format!("{input_desc}_next");
let mut child_stream = self.child.execute();

let span = || {
let mut span = Span::enter_with_local_parent("next");
span.add_property(|| ("otel.name", span_name.to_string()));
span.add_property(|| ("next", input_desc.to_string()));
span
};

loop {
select! {
// We prioritize abort signal over normal data chunks.
Expand All @@ -94,7 +87,7 @@ impl Executor for ManagedExecutor {
}
}
}
res = child_stream.next().in_span(span()) => {
res = child_stream.next().instrument(tracing::trace_span!("next", otel.name = span_name.as_str(), next = input_desc)) => {
if let Some(chunk) = res {
match chunk {
Ok(chunk) => {
Expand Down
Loading

0 comments on commit 2b2950d

Please sign in to comment.