@@ -46,6 +46,8 @@ pub struct KeeperMetrics {
4646 pub block_timestamp_lag : Family < ChainIdLabel , Gauge > ,
4747 pub block_timestamp : Family < ChainIdLabel , Gauge > ,
4848 pub process_event_timestamp : Family < ChainIdLabel , Gauge > ,
49+ pub block_number : Family < ChainIdLabel , Gauge > ,
50+ pub process_event_block_number : Family < ChainIdLabel , Gauge > ,
4951}
5052
5153impl Default for KeeperMetrics {
@@ -91,6 +93,8 @@ impl Default for KeeperMetrics {
9193 block_timestamp_lag : Family :: default ( ) ,
9294 block_timestamp : Family :: default ( ) ,
9395 process_event_timestamp : Family :: default ( ) ,
96+ block_number : Family :: default ( ) ,
97+ process_event_block_number : Family :: default ( ) ,
9498 }
9599 }
96100}
@@ -244,6 +248,18 @@ impl KeeperMetrics {
244248 keeper_metrics. process_event_timestamp . clone ( ) ,
245249 ) ;
246250
251+ writable_registry. register (
252+ "block_number" ,
253+ "The current block number" ,
254+ keeper_metrics. block_number . clone ( ) ,
255+ ) ;
256+
257+ writable_registry. register (
258+ "process_event_block_number" ,
259+ "The highest block number for which events have been successfully retrieved and processed" ,
260+ keeper_metrics. process_event_block_number . clone ( ) ,
261+ ) ;
262+
247263 // *Important*: When adding a new metric:
248264 // 1. Register it above using `writable_registry.register(...)`
249265 // 2. Add a get_or_create call in the add_chain function below to initialize it for each chain/provider pair
@@ -259,6 +275,10 @@ impl KeeperMetrics {
259275 let _ = self . block_timestamp_lag . get_or_create ( & chain_id_label) ;
260276 let _ = self . block_timestamp . get_or_create ( & chain_id_label) ;
261277 let _ = self . process_event_timestamp . get_or_create ( & chain_id_label) ;
278+ let _ = self . block_number . get_or_create ( & chain_id_label) ;
279+ let _ = self
280+ . process_event_block_number
281+ . get_or_create ( & chain_id_label) ;
262282
263283 let account_label = AccountLabel {
264284 chain_id,
0 commit comments