Skip to content

Commit 611aab2

Browse files
batcher: register blockifier metrics
1 parent aa746ef commit 611aab2

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

crates/apollo_batcher/src/metrics.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
use apollo_batcher_types::communication::BATCHER_REQUEST_LABELS;
22
use apollo_metrics::define_metrics;
3+
use blockifier::metrics::{
4+
CALLS_RUNNING_NATIVE,
5+
CLASS_CACHE_HITS,
6+
CLASS_CACHE_MISSES,
7+
NATIVE_CLASS_RETURNED,
8+
NATIVE_COMPILATION_ERROR,
9+
TOTAL_CALLS,
10+
};
311
use starknet_api::block::BlockNumber;
412

513
define_metrics!(
@@ -53,6 +61,14 @@ pub fn register_metrics(storage_height: BlockNumber) {
5361

5462
FULL_BLOCKS.register();
5563
PRECONFIRMED_BLOCK_WRITTEN.register();
64+
65+
// Blockifier's metrics
66+
CALLS_RUNNING_NATIVE.register();
67+
CLASS_CACHE_HITS.register();
68+
CLASS_CACHE_MISSES.register();
69+
NATIVE_CLASS_RETURNED.register();
70+
NATIVE_COMPILATION_ERROR.register();
71+
TOTAL_CALLS.register();
5672
}
5773

5874
/// A handle to update the proposal metrics when the proposal is created and dropped.

crates/apollo_dashboard/resources/dev_grafana_alerts_mainnet.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@
652652
"name": "native_compilation_error",
653653
"title": "Native compilation alert",
654654
"ruleGroup": "batcher",
655-
"expr": "increase(native_compilation_error[1h])",
655+
"expr": "increase(native_compilation_error{cluster=~\"$cluster\", namespace=~\"$namespace\"}[1h])",
656656
"conditions": [
657657
{
658658
"evaluator": {
@@ -673,7 +673,7 @@
673673
],
674674
"for": "30s",
675675
"intervalSec": 30,
676-
"severity": "p5"
676+
"severity": "p4"
677677
},
678678
{
679679
"name": "batched_transactions_stuck",

crates/apollo_dashboard/resources/dev_grafana_alerts_testnet.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@
652652
"name": "native_compilation_error",
653653
"title": "Native compilation alert",
654654
"ruleGroup": "batcher",
655-
"expr": "increase(native_compilation_error[1h])",
655+
"expr": "increase(native_compilation_error{cluster=~\"$cluster\", namespace=~\"$namespace\"}[1h])",
656656
"conditions": [
657657
{
658658
"evaluator": {
@@ -673,7 +673,7 @@
673673
],
674674
"for": "30s",
675675
"intervalSec": 30,
676-
"severity": "p5"
676+
"severity": "p4"
677677
},
678678
{
679679
"name": "batched_transactions_stuck",

crates/apollo_dashboard/src/alert_definitions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,15 @@ fn get_native_compilation_error_increase() -> Alert {
354354
"native_compilation_error",
355355
"Native compilation alert",
356356
AlertGroup::Batcher,
357-
format!("increase({}[1h])", NATIVE_COMPILATION_ERROR.get_name()),
357+
format!("increase({}[1h])", NATIVE_COMPILATION_ERROR.get_name_with_filter()),
358358
vec![AlertCondition {
359359
comparison_op: AlertComparisonOp::GreaterThan,
360360
comparison_value: 0.0,
361361
logical_op: AlertLogicalOp::And,
362362
}],
363363
PENDING_DURATION_DEFAULT,
364364
EVALUATION_INTERVAL_SEC_DEFAULT,
365-
AlertSeverity::Informational,
365+
AlertSeverity::WorkingHours,
366366
AlertEnvFiltering::All,
367367
)
368368
}

0 commit comments

Comments
 (0)