Skip to content

Commit

Permalink
add retry metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
yufansong committed Mar 7, 2024
1 parent 3774877 commit efe51b9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/dashboards/risingwave-dev-dashboard.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions grafana/risingwave-dev-dashboard.dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -4068,6 +4068,10 @@ def section_udf(outer_panels):
f"sum(rate({metric('udf_failure_count')}[$__rate_interval])) by ({COMPONENT_LABEL}, {NODE_LABEL})",
"udf_failure_count - {{%s}}" % NODE_LABEL,
),
panels.target(
f"sum(rate({metric('udf_retry_count')}[$__rate_interval])) by ({COMPONENT_LABEL}, {NODE_LABEL})",
"udf_retry_count - {{%s}}" % NODE_LABEL,
),
panels.target(
f"sum(rate({metric('udf_success_count')}[$__rate_interval])) by (link, name, fragment_id)",
"udf_success_count - {{link}} {{name}} {{fragment_id}}",
Expand All @@ -4076,6 +4080,10 @@ def section_udf(outer_panels):
f"sum(rate({metric('udf_failure_count')}[$__rate_interval])) by (link, name, fragment_id)",
"udf_failure_count - {{link}} {{name}} {{fragment_id}}",
),
panels.target(
f"sum(rate({metric('udf_retry_count')}[$__rate_interval])) by ({COMPONENT_LABEL}, {NODE_LABEL})",
"udf_retry_count - {{%s}}" % NODE_LABEL,
),
],
),
panels.timeseries_count(
Expand Down
2 changes: 1 addition & 1 deletion grafana/risingwave-dev-dashboard.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/expr/udf/src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl ArrowFlightUdfClient {
return ret;
}
}
metrics.udf_failure_count.with_label_values(labels).inc();
metrics.udf_retry_count.with_label_values(labels).inc();
tokio::time::sleep(backoff).await;
backoff *= 2;
}
Expand Down
10 changes: 10 additions & 0 deletions src/expr/udf/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pub struct Metrics {
pub udf_success_count: IntCounterVec,
/// Number of failed UDF calls.
pub udf_failure_count: IntCounterVec,
/// Total number of retried UDF calls.
pub udf_retry_count: IntCounterVec,
/// Input chunk rows of UDF calls.
pub udf_input_chunk_rows: HistogramVec,
/// The latency of UDF calls in seconds.
Expand Down Expand Up @@ -58,6 +60,13 @@ impl Metrics {
registry
)
.unwrap();
let udf_retry_count = register_int_counter_vec_with_registry!(
"udf_retry_count",
"Total number of retried UDF calls",
labels,
registry
)
.unwrap();
let udf_input_chunk_rows = register_histogram_vec_with_registry!(
"udf_input_chunk_rows",
"Input chunk rows of UDF calls",
Expand Down Expand Up @@ -92,6 +101,7 @@ impl Metrics {
Metrics {
udf_success_count,
udf_failure_count,
udf_retry_count,
udf_input_chunk_rows,
udf_latency,
udf_input_rows,
Expand Down

0 comments on commit efe51b9

Please sign in to comment.