Skip to content

Commit 209731c

Browse files
apollo_dashboard: add SNIP-35 row
1 parent 77f5bbd commit 209731c

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
@@ -341,6 +341,47 @@
341341
],
342342
"collapsed": true
343343
},
344+
"SNIP-35": {
345+
"panels": [
346+
{
347+
"title": "SNIP-35 fee_actual (GFri)",
348+
"description": "Median of recent fee_proposals over the sliding window, in GFri",
349+
"type": "timeseries",
350+
"exprs": [
351+
"snip35_fee_actual{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9"
352+
],
353+
"extra_params": {}
354+
},
355+
{
356+
"title": "SNIP-35 fee_proposal (GFri)",
357+
"description": "fee_proposal this node published in the latest block, in GFri",
358+
"type": "timeseries",
359+
"exprs": [
360+
"snip35_fee_proposal{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9"
361+
],
362+
"extra_params": {}
363+
},
364+
{
365+
"title": "SNIP-35 fee_target (GFri)",
366+
"description": "fee_target computed from the STRK/USD oracle, in GFri",
367+
"type": "timeseries",
368+
"exprs": [
369+
"snip35_fee_target{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9"
370+
],
371+
"extra_params": {}
372+
},
373+
{
374+
"title": "SNIP-35 STRK/USD rate (USD)",
375+
"description": "STRK/USD rate from the oracle, in USD (raw value has 18 decimals)",
376+
"type": "timeseries",
377+
"exprs": [
378+
"snip35_strk_usd_rate{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e18"
379+
],
380+
"extra_params": {}
381+
}
382+
],
383+
"collapsed": true
384+
},
344385
"Staking": {
345386
"panels": [
346387
{

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)