Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't initialize executor_row_count metrics when disabled #18836

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/stream/src/executor/wrapper/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ pub async fn trace(
let actor_id_str = actor_ctx.id.to_string();
let fragment_id_str = actor_ctx.fragment_id.to_string();

let executor_row_count = actor_ctx
.streaming_metrics
.executor_row_count
.with_guarded_label_values(&[&actor_id_str, &fragment_id_str, &info.identity]);
let executor_row_count = if enable_executor_row_count {
let count = actor_ctx
.streaming_metrics
.executor_row_count
.with_guarded_label_values(&[&actor_id_str, &fragment_id_str, &info.identity]);
Some(count)
} else {
None
};

let new_span = || {
tracing::info_span!(
Expand All @@ -54,8 +59,8 @@ pub async fn trace(
// Emit a debug event and record the message type.
match &message {
Message::Chunk(chunk) => {
if enable_executor_row_count {
executor_row_count.inc_by(chunk.cardinality() as u64);
if let Some(count) = &executor_row_count {
count.inc_by(chunk.cardinality() as u64);
}
tracing::debug!(
target: "events::stream::message::chunk",
Expand Down
Loading