Skip to content

Commit a9cbd37

Browse files
apollo_dashboard: add SNIP-35 row
1 parent 206a807 commit a9cbd37

3 files changed

Lines changed: 95 additions & 0 deletions

File tree

crates/apollo_dashboard/resources/dev_grafana.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,47 @@
15081508
],
15091509
"collapsed": true
15101510
},
1511+
"SNIP-35": {
1512+
"panels": [
1513+
{
1514+
"title": "SNIP-35 fee_actual (GFri)",
1515+
"description": "Median of recent fee_proposals over the sliding window, in GFri",
1516+
"type": "timeseries",
1517+
"exprs": [
1518+
"snip35_fee_actual{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9"
1519+
],
1520+
"extra_params": {}
1521+
},
1522+
{
1523+
"title": "SNIP-35 fee_proposal (GFri)",
1524+
"description": "fee_proposal this node published in the latest block, in GFri",
1525+
"type": "timeseries",
1526+
"exprs": [
1527+
"snip35_fee_proposal{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9"
1528+
],
1529+
"extra_params": {}
1530+
},
1531+
{
1532+
"title": "SNIP-35 fee_target (GFri)",
1533+
"description": "fee_target computed from the STRK/USD oracle, in GFri",
1534+
"type": "timeseries",
1535+
"exprs": [
1536+
"snip35_fee_target{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9"
1537+
],
1538+
"extra_params": {}
1539+
},
1540+
{
1541+
"title": "SNIP-35 STRK/USD rate (USD)",
1542+
"description": "STRK/USD rate from the oracle, in USD (raw value has 18 decimals)",
1543+
"type": "timeseries",
1544+
"exprs": [
1545+
"snip35_strk_usd_rate{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e18"
1546+
],
1547+
"extra_params": {}
1548+
}
1549+
],
1550+
"collapsed": true
1551+
},
15111552
"Blockifier": {
15121553
"panels": [
15131554
{

crates/apollo_dashboard/src/dashboard_definitions.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use crate::panels::consensus::{
2929
get_panel_consensus_block_number_diff_from_sync,
3030
get_panel_consensus_decisions_reached_as_proposer_counter,
3131
get_panel_consensus_round,
32+
get_snip35_row,
3233
};
3334
use crate::panels::gateway::{get_gateway_row, get_panel_gateway_add_tx_failure_by_reason};
3435
use crate::panels::http_server::{
@@ -100,6 +101,7 @@ pub fn get_apollo_dashboard() -> Dashboard {
100101
get_upgrade_row(),
101102
get_l1_events_row(),
102103
get_l1_gas_price_row(),
104+
get_snip35_row(),
103105
get_blockifier_row(),
104106
get_compile_to_casm_row(),
105107
get_consensus_p2p_row(),

crates/apollo_dashboard/src/panels/consensus.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ use apollo_consensus_orchestrator::metrics::{
5656
LABEL_BUILD_PROPOSAL_FAILURE_REASON,
5757
LABEL_CENDE_FAILURE_REASON,
5858
LABEL_VALIDATE_PROPOSAL_FAILURE_REASON,
59+
SNIP35_FEE_ACTUAL,
60+
SNIP35_FEE_PROPOSAL,
61+
SNIP35_FEE_TARGET,
62+
SNIP35_STRK_USD_RATE,
5963
};
6064
use apollo_metrics::metrics::MetricQueryName;
6165
use apollo_network::metrics::{LABEL_NAME_BROADCAST_DROP_REASON, LABEL_NAME_EVENT_TYPE};
@@ -708,6 +712,54 @@ pub(crate) fn get_cende_row() -> Row {
708712
)
709713
}
710714

715+
fn get_panel_snip35_fee_actual() -> Panel {
716+
Panel::new(
717+
"SNIP-35 fee_actual (GFri)",
718+
"Median of recent fee_proposals over the sliding window, in GFri",
719+
format!("{} / 1e9", SNIP35_FEE_ACTUAL.get_name_with_filter()),
720+
PanelType::TimeSeries,
721+
)
722+
}
723+
724+
fn get_panel_snip35_fee_proposal() -> Panel {
725+
Panel::new(
726+
"SNIP-35 fee_proposal (GFri)",
727+
"fee_proposal this node published in the latest block, in GFri",
728+
format!("{} / 1e9", SNIP35_FEE_PROPOSAL.get_name_with_filter()),
729+
PanelType::TimeSeries,
730+
)
731+
}
732+
733+
fn get_panel_snip35_fee_target() -> Panel {
734+
Panel::new(
735+
"SNIP-35 fee_target (GFri)",
736+
"fee_target computed from the STRK/USD oracle, in GFri",
737+
format!("{} / 1e9", SNIP35_FEE_TARGET.get_name_with_filter()),
738+
PanelType::TimeSeries,
739+
)
740+
}
741+
742+
fn get_panel_snip35_strk_usd_rate() -> Panel {
743+
Panel::new(
744+
"SNIP-35 STRK/USD rate (USD)",
745+
"STRK/USD rate from the oracle, in USD (raw value has 18 decimals)",
746+
format!("{} / 1e18", SNIP35_STRK_USD_RATE.get_name_with_filter()),
747+
PanelType::TimeSeries,
748+
)
749+
}
750+
751+
pub(crate) fn get_snip35_row() -> Row {
752+
Row::new(
753+
"SNIP-35",
754+
vec![
755+
get_panel_snip35_fee_actual(),
756+
get_panel_snip35_fee_proposal(),
757+
get_panel_snip35_fee_target(),
758+
get_panel_snip35_strk_usd_rate(),
759+
],
760+
)
761+
}
762+
711763
pub(crate) fn get_consensus_p2p_row() -> Row {
712764
Row::new(
713765
"ConsensusP2p",

0 commit comments

Comments
 (0)