Skip to content

Commit 491ff5b

Browse files
authored
apollo_dashboard: make sync dashboard clearer (#12805)
1 parent dc70445 commit 491ff5b

2 files changed

Lines changed: 38 additions & 59 deletions

File tree

crates/apollo_dashboard/resources/dev_grafana.json

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -752,17 +752,26 @@
752752
"State Sync": {
753753
"panels": [
754754
{
755-
"title": "Central Block Marker",
756-
"description": "The first block number that doesn't exist yet",
755+
"title": "Current Feeder Gateway Marker",
756+
"description": "The latest block number available in the feeder gateway + 1",
757757
"type": "stat",
758758
"exprs": [
759759
"apollo_central_sync_central_block_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
760760
],
761761
"extra_params": {}
762762
},
763+
{
764+
"title": "Current Sync Marker",
765+
"description": "The first block that hasn't been fully downloaded",
766+
"type": "stat",
767+
"exprs": [
768+
"apollo_state_sync_class_manager_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
769+
],
770+
"extra_params": {}
771+
},
763772
{
764773
"title": "Time to Complete Sync",
765-
"description": "Estimated time to complete syncing to the latest block (based on a 10m window rate).\nThe value is computed from the sync rate of the `class manager marker` (which is the last component to finish downloading among all state sync parts), compared against the `central block marker` (the latest block known to central).",
774+
"description": "Estimated time to complete syncing to the latest block (based on a 10m window rate).\nThe value is computed from the sync rate of the `current sync marker` compared against the `current feeder gateway marker`.",
766775
"type": "timeseries",
767776
"exprs": [
768777
"(apollo_central_sync_central_block_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} - apollo_state_sync_class_manager_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}) / clamp_min(rate(apollo_state_sync_class_manager_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}[10m]) - rate(apollo_central_sync_central_block_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}[10m]), 1)"
@@ -772,8 +781,8 @@
772781
}
773782
},
774783
{
775-
"title": "Sync Diff From Central",
776-
"description": "The number of blocks that were not fully synced yet",
784+
"title": "Sync Diff From Feeder Gateway",
785+
"description": "The number of blocks that exist in the feeder but weren't downloaded yet",
777786
"type": "timeseries",
778787
"exprs": [
779788
"apollo_central_sync_central_block_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} - apollo_state_sync_class_manager_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
@@ -782,7 +791,7 @@
782791
},
783792
{
784793
"title": "Sync Block Age",
785-
"description": "The time from a block’s timestamp until its header is synced through the feeder-gateway.",
794+
"description": "The time from a block’s timestamp until its header is downloaded.",
786795
"type": "timeseries",
787796
"exprs": [
788797
"apollo_state_sync_header_latency{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
@@ -792,31 +801,13 @@
792801
}
793802
},
794803
{
795-
"title": "State Sync Body Marker",
796-
"description": "The first block number for which the state sync component does not have a body",
804+
"title": "Current Sync Body Marker",
805+
"description": "The first block whose body hasn't been downloaded",
797806
"type": "stat",
798807
"exprs": [
799808
"apollo_state_sync_body_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
800809
],
801810
"extra_params": {}
802-
},
803-
{
804-
"title": "State Sync Class Manager Marker",
805-
"description": "The first block number for which the state sync component does not have a class",
806-
"type": "stat",
807-
"exprs": [
808-
"apollo_state_sync_class_manager_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
809-
],
810-
"extra_params": {}
811-
},
812-
{
813-
"title": "State Sync Compiled Class Marker",
814-
"description": "The first block number for which the state sync component does not have all of the corresponding compiled classes",
815-
"type": "stat",
816-
"exprs": [
817-
"apollo_state_sync_compiled_class_marker{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"}"
818-
],
819-
"extra_params": {}
820811
}
821812
],
822813
"collapsed": true

crates/apollo_dashboard/src/panels/state_sync.rs

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,41 @@ use apollo_state_sync_metrics::metrics::{
33
CENTRAL_SYNC_CENTRAL_BLOCK_MARKER,
44
STATE_SYNC_BODY_MARKER,
55
STATE_SYNC_CLASS_MANAGER_MARKER,
6-
STATE_SYNC_COMPILED_CLASS_MARKER,
76
STATE_SYNC_HEADER_LATENCY_SEC,
87
};
98

109
use crate::dashboard::Row;
1110
use crate::panel::{Panel, PanelType, Unit};
1211
use crate::query_builder::DEFAULT_DURATION;
1312

14-
fn get_panel_central_sync_central_block_marker() -> Panel {
13+
fn get_panel_current_feeder_gateway_marker() -> Panel {
1514
Panel::new(
16-
"Central Block Marker",
17-
"The first block number that doesn't exist yet",
15+
"Current Feeder Gateway Marker",
16+
"The latest block number available in the feeder gateway + 1",
1817
CENTRAL_SYNC_CENTRAL_BLOCK_MARKER.get_name_with_filter().to_string(),
1918
PanelType::Stat,
2019
)
2120
}
22-
fn get_panel_state_sync_body_marker() -> Panel {
21+
fn get_panel_sync_body_marker() -> Panel {
2322
Panel::new(
24-
"State Sync Body Marker",
25-
"The first block number for which the state sync component does not have a body",
23+
"Current Sync Body Marker",
24+
"The first block whose body hasn't been downloaded",
2625
STATE_SYNC_BODY_MARKER.get_name_with_filter().to_string(),
2726
PanelType::Stat,
2827
)
2928
}
30-
fn get_panel_state_sync_class_manager_marker() -> Panel {
29+
fn get_panel_current_sync_marker() -> Panel {
3130
Panel::new(
32-
"State Sync Class Manager Marker",
33-
"The first block number for which the state sync component does not have a class",
31+
"Current Sync Marker",
32+
"The first block that hasn't been fully downloaded",
3433
STATE_SYNC_CLASS_MANAGER_MARKER.get_name_with_filter().to_string(),
3534
PanelType::Stat,
3635
)
3736
}
38-
fn get_panel_state_sync_compiled_class_marker() -> Panel {
37+
fn get_panel_sync_diff_from_feeder_gateway() -> Panel {
3938
Panel::new(
40-
"State Sync Compiled Class Marker",
41-
"The first block number for which the state sync component does not have all of the \
42-
corresponding compiled classes",
43-
STATE_SYNC_COMPILED_CLASS_MARKER.get_name_with_filter().to_string(),
44-
PanelType::Stat,
45-
)
46-
}
47-
fn get_panel_state_sync_diff_from_central() -> Panel {
48-
Panel::new(
49-
"Sync Diff From Central",
50-
"The number of blocks that were not fully synced yet",
39+
"Sync Diff From Feeder Gateway",
40+
"The number of blocks that exist in the feeder but weren't downloaded yet",
5141
format!(
5242
"{} - {}",
5343
CENTRAL_SYNC_CENTRAL_BLOCK_MARKER.get_name_with_filter(),
@@ -56,10 +46,10 @@ fn get_panel_state_sync_diff_from_central() -> Panel {
5646
PanelType::TimeSeries,
5747
)
5848
}
59-
fn get_panel_state_sync_new_header_maturity() -> Panel {
49+
fn get_panel_sync_block_age() -> Panel {
6050
Panel::new(
6151
"Sync Block Age",
62-
"The time from a block’s timestamp until its header is synced through the feeder-gateway.",
52+
"The time from a block’s timestamp until its header is downloaded.",
6353
STATE_SYNC_HEADER_LATENCY_SEC.get_name_with_filter().to_string(),
6454
PanelType::TimeSeries,
6555
)
@@ -70,9 +60,8 @@ fn get_panel_time_to_complete_sync() -> Panel {
7060
"Time to Complete Sync",
7161
format!(
7262
"Estimated time to complete syncing to the latest block (based on a {} window \
73-
rate).\nThe value is computed from the sync rate of the `class manager marker` \
74-
(which is the last component to finish downloading among all state sync parts), \
75-
compared against the `central block marker` (the latest block known to central).",
63+
rate).\nThe value is computed from the sync rate of the `current sync marker` \
64+
compared against the `current feeder gateway marker`.",
7665
DEFAULT_DURATION
7766
),
7867
format!(
@@ -91,13 +80,12 @@ pub(crate) fn get_state_sync_row() -> Row {
9180
Row::new(
9281
"State Sync",
9382
vec![
94-
get_panel_central_sync_central_block_marker(),
83+
get_panel_current_feeder_gateway_marker(),
84+
get_panel_current_sync_marker(),
9585
get_panel_time_to_complete_sync(),
96-
get_panel_state_sync_diff_from_central(),
97-
get_panel_state_sync_new_header_maturity(),
98-
get_panel_state_sync_body_marker(),
99-
get_panel_state_sync_class_manager_marker(),
100-
get_panel_state_sync_compiled_class_marker(),
86+
get_panel_sync_diff_from_feeder_gateway(),
87+
get_panel_sync_block_age(),
88+
get_panel_sync_body_marker(),
10189
],
10290
)
10391
}

0 commit comments

Comments
 (0)