Skip to content

Commit de86f94

Browse files
authored
feat(storage): add metrics for iter_log (#16658)
1 parent 5ba1874 commit de86f94

10 files changed

+449
-151
lines changed

docker/dashboards/risingwave-dev-dashboard.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docker/dashboards/risingwave-user-dashboard.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

grafana/risingwave-dev-dashboard.dashboard.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,26 +2006,26 @@ def section_hummock_read(outer_panels):
20062006
[
20072007
*quantile(
20082008
lambda quantile, legend: panels.target(
2009-
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_init_duration_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id))",
2010-
f"create_iter_time p{legend} - {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
2009+
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_init_duration_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id, iter_type))",
2010+
f"create_iter_time p{legend} - {{{{iter_type}}}} {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
20112011
),
20122012
[50, 99, "max"],
20132013
),
20142014
panels.target(
2015-
f"sum by(le, {COMPONENT_LABEL}, {NODE_LABEL})(rate({metric('state_store_iter_init_duration_sum')}[$__rate_interval])) / sum by(le, {COMPONENT_LABEL}, {NODE_LABEL}) (rate({metric('state_store_iter_init_duration_count')}[$__rate_interval])) > 0",
2016-
"create_iter_time avg - {{%s}} @ {{%s}}"
2015+
f"sum by(le, {COMPONENT_LABEL}, {NODE_LABEL})(rate({metric('state_store_iter_init_duration_sum')}[$__rate_interval])) / sum by(le, {COMPONENT_LABEL}, {NODE_LABEL}, iter_type) (rate({metric('state_store_iter_init_duration_count')}[$__rate_interval])) > 0",
2016+
"create_iter_time avg - {{iter_type}} {{%s}} @ {{%s}}"
20172017
% (COMPONENT_LABEL, NODE_LABEL),
20182018
),
20192019
*quantile(
20202020
lambda quantile, legend: panels.target(
2021-
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_scan_duration_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id))",
2022-
f"pure_scan_time p{legend} - {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
2021+
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_scan_duration_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id, iter_type))",
2022+
f"pure_scan_time p{legend} - {{{{iter_type}}}} {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
20232023
),
20242024
[50, 99, "max"],
20252025
),
20262026
panels.target(
2027-
f"sum by(le, {COMPONENT_LABEL}, {NODE_LABEL})(rate({metric('state_store_iter_scan_duration_sum')}[$__rate_interval])) / sum by(le, {COMPONENT_LABEL}, {NODE_LABEL}) (rate({metric('state_store_iter_scan_duration_count')}[$__rate_interval])) > 0",
2028-
"pure_scan_time avg - {{%s}} @ {{%s}}"
2027+
f"sum by(le, {COMPONENT_LABEL}, {NODE_LABEL})(rate({metric('state_store_iter_scan_duration_sum')}[$__rate_interval])) / sum by(le, {COMPONENT_LABEL}, {NODE_LABEL}, iter_type) (rate({metric('state_store_iter_scan_duration_count')}[$__rate_interval])) > 0",
2028+
"pure_scan_time avg - {{iter_type}} {{%s}} @ {{%s}}"
20292029
% (COMPONENT_LABEL, NODE_LABEL),
20302030
),
20312031
],
@@ -2093,8 +2093,8 @@ def section_hummock_read(outer_panels):
20932093
% (COMPONENT_LABEL, NODE_LABEL),
20942094
),
20952095
panels.target(
2096-
f"sum(rate({table_metric('state_store_iter_in_process_counts')}[$__rate_interval])) by ({COMPONENT_LABEL},{NODE_LABEL},table_id)",
2097-
"iter - {{table_id}} @ {{%s}} @ {{%s}}"
2096+
f"sum(rate({table_metric('state_store_iter_counts')}[$__rate_interval])) by ({COMPONENT_LABEL},{NODE_LABEL},table_id, iter_type)",
2097+
"{{iter_type}} - {{table_id}} @ {{%s}} @ {{%s}}"
20982098
% (COMPONENT_LABEL, NODE_LABEL),
20992099
),
21002100
],
@@ -2118,8 +2118,8 @@ def section_hummock_read(outer_panels):
21182118
[
21192119
*quantile(
21202120
lambda quantile, legend: panels.target(
2121-
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_size_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id))",
2122-
f"p{legend} - {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
2121+
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_size_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id, iter_type))",
2122+
f"p{legend} - {{{{iter_type}}}} {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
21232123
),
21242124
[50, 99, "max"],
21252125
),
@@ -2144,11 +2144,19 @@ def section_hummock_read(outer_panels):
21442144
[
21452145
*quantile(
21462146
lambda quantile, legend: panels.target(
2147-
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_item_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id))",
2148-
f"p{legend} - {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
2147+
f"histogram_quantile({quantile}, sum(rate({table_metric('state_store_iter_item_bucket')}[$__rate_interval])) by (le, {COMPONENT_LABEL}, {NODE_LABEL}, table_id, iter_type))",
2148+
f"p{legend} - {{{{iter_type}}}} {{{{table_id}}}} @ {{{{{COMPONENT_LABEL}}}}} @ {{{{{NODE_LABEL}}}}}",
21492149
),
21502150
[50, 99, "max"],
21512151
),
2152+
panels.target(
2153+
f"{metric('state_store_iter_in_progress_counts')}",
2154+
"Existing {{iter_type}} count @ {{table_id}}",
2155+
),
2156+
panels.target(
2157+
f"sum(rate({metric('state_store_iter_log_op_type_counts')}[$__rate_interval])) by (table_id, op_type)",
2158+
"iter_log op count @ {{table_id}} {{op_type}}",
2159+
),
21522160
],
21532161
),
21542162
panels.timeseries_bytes_per_sec(

grafana/risingwave-dev-dashboard.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

grafana/risingwave-user-dashboard.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/common/metrics/src/relabeled_metric.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use prometheus::core::{MetricVec, MetricVecBuilder};
1616
use prometheus::{HistogramVec, IntCounterVec};
1717

1818
use crate::{
19-
LabelGuardedHistogramVec, LabelGuardedIntCounterVec, LabelGuardedMetric, LabelGuardedMetricVec,
20-
MetricLevel,
19+
LabelGuardedHistogramVec, LabelGuardedIntCounterVec, LabelGuardedIntGaugeVec,
20+
LabelGuardedMetric, LabelGuardedMetricVec, MetricLevel,
2121
};
2222

2323
/// For all `Relabeled*Vec` below,
@@ -108,3 +108,5 @@ pub type RelabeledGuardedHistogramVec<const N: usize> =
108108
RelabeledMetricVec<LabelGuardedHistogramVec<N>>;
109109
pub type RelabeledGuardedIntCounterVec<const N: usize> =
110110
RelabeledMetricVec<LabelGuardedIntCounterVec<N>>;
111+
pub type RelabeledGuardedIntGaugeVec<const N: usize> =
112+
RelabeledMetricVec<LabelGuardedIntGaugeVec<N>>;

0 commit comments

Comments
 (0)