-
Notifications
You must be signed in to change notification settings - Fork 605
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
feat(metrics): add counter for retry create stream reader #20258
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -543,14 +543,20 @@ impl<S: StateStore> SourceExecutor<S> { | |
let source_reader = source_desc.source.clone(); | ||
let (column_ids, source_ctx) = self.prepare_source_stream_build(&source_desc); | ||
let source_ctx = Arc::new(source_ctx); | ||
let source_ctx_clone = source_ctx.clone(); | ||
let mut build_source_stream_fut = Box::pin(async move { | ||
let backoff = get_infinite_backoff_strategy(); | ||
tokio_retry::Retry::spawn(backoff, || async { | ||
let source_ctx_inner = source_ctx_clone.clone(); | ||
source_ctx_inner.metrics.init_stream_reader_retry_count.with_guarded_label_values(&[ | ||
&source_ctx_inner.actor_id.to_string(), | ||
&source_ctx_inner.source_name, | ||
]).inc(); | ||
Comment on lines
+550
to
+554
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we simply move this into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am struggling with it too, suspect somewhere calls a rate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the reason is RW is reporting the metric from multiple nodes and the count value from each node varies, leading to the fluctuation. |
||
match source_reader | ||
.build_stream( | ||
recover_state.clone(), | ||
column_ids.clone(), | ||
source_ctx.clone(), | ||
source_ctx_inner, | ||
false, // not need to seek to latest since source state is initialized | ||
) | ||
.await { | ||
|
@@ -619,7 +625,15 @@ impl<S: StateStore> SourceExecutor<S> { | |
); | ||
} | ||
} else { | ||
assert!(reader_and_splits.is_some()); | ||
debug_assert!(reader_and_splits.is_some()); | ||
source_ctx | ||
.metrics | ||
.init_stream_reader_retry_count | ||
.with_guarded_label_values(&[ | ||
&source_ctx.actor_id.to_string(), | ||
&source_ctx.source_name, | ||
]) | ||
.reset(); | ||
tracing::info!("source stream created successfully"); | ||
break; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add this to grafana dashboard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it overlaps with
source_status_is_up
(from source enumerator), so I don't add it to grafana.But here we focus more on the retry on the compute node, planning add it to cloud alert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I don't know we have
source_status_is_up
!Then what about adding it to the same panel (
Source Upstream Status
), so that we can both know whether the source is up on meta and each CN. 🤔