From 007e2d51898178f043912afacdfa321978b77385 Mon Sep 17 00:00:00 2001 From: Ayelet Zilber Date: Wed, 16 Jul 2025 15:40:39 +0300 Subject: [PATCH] apollo_dashboard: add reverted transactions ratio panel --- crates/apollo_dashboard/resources/dev_grafana.json | 9 +++++++++ crates/apollo_dashboard/src/panels/batcher.rs | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/crates/apollo_dashboard/resources/dev_grafana.json b/crates/apollo_dashboard/resources/dev_grafana.json index 31e35d7c29b..eaa825c1273 100644 --- a/crates/apollo_dashboard/resources/dev_grafana.json +++ b/crates/apollo_dashboard/resources/dev_grafana.json @@ -54,6 +54,15 @@ "100 * (increase(batcher_rejected_transactions{cluster=~\"$cluster\", namespace=~\"$namespace\"}[5m]) / (increase(batcher_rejected_transactions{cluster=~\"$cluster\", namespace=~\"$namespace\"}[5m]) + increase(batcher_batched_transactions{cluster=~\"$cluster\", namespace=~\"$namespace\"}[5m])))" ], "extra_params": {} + }, + { + "title": "reverted_transactions_ratio", + "description": "Ratio of reverted transactions out of all processed, over the last 5 minutes", + "type": "timeseries", + "exprs": [ + "100 * (increase(batcher_reverted_transactions{cluster=~\"$cluster\", namespace=~\"$namespace\"}[5m]) / (increase(batcher_rejected_transactions{cluster=~\"$cluster\", namespace=~\"$namespace\"}[5m]) + increase(batcher_batched_transactions{cluster=~\"$cluster\", namespace=~\"$namespace\"}[5m])))" + ], + "extra_params": {} } ], "Consensus": [ diff --git a/crates/apollo_dashboard/src/panels/batcher.rs b/crates/apollo_dashboard/src/panels/batcher.rs index a192bf31398..1f6aeabd621 100644 --- a/crates/apollo_dashboard/src/panels/batcher.rs +++ b/crates/apollo_dashboard/src/panels/batcher.rs @@ -5,6 +5,7 @@ use apollo_batcher::metrics::{ PROPOSAL_STARTED, PROPOSAL_SUCCEEDED, REJECTED_TRANSACTIONS, + REVERTED_TRANSACTIONS, }; use apollo_infra::metrics::{ BATCHER_LOCAL_MSGS_PROCESSED, @@ -63,6 +64,15 @@ fn get_panel_rejection_ratio() -> Panel { "5m", ) } +fn get_panel_reverted_transaction_ratio() -> Panel { + Panel::ratio_time_series( + "reverted_transactions_ratio", + "Ratio of reverted transactions out of all processed, over the last 5 minutes", + &REVERTED_TRANSACTIONS, + &[&REJECTED_TRANSACTIONS, &BATCHED_TRANSACTIONS], + "5m", + ) +} pub(crate) fn get_batcher_row() -> Row { Row::new( @@ -74,6 +84,7 @@ pub(crate) fn get_batcher_row() -> Row { get_panel_batched_transactions(), get_panel_last_batched_block(), get_panel_rejection_ratio(), + get_panel_reverted_transaction_ratio(), ], ) }