@@ -27,6 +27,7 @@ pub struct BatcherMetrics {
2727 pub cancel_create_new_task_duration : IntGauge ,
2828 pub batcher_gas_cost_create_task_total : GenericCounter < AtomicF64 > ,
2929 pub batcher_gas_cost_cancel_task_total : GenericCounter < AtomicF64 > ,
30+ pub available_data_services : IntGauge ,
3031}
3132
3233impl BatcherMetrics {
@@ -79,6 +80,10 @@ impl BatcherMetrics {
7980 "batcher_gas_cost_cancel_task_total" ,
8081 "Batcher Gas Cost Cancel Task Total"
8182 ) ) ?;
83+ let available_data_services = register_int_gauge ! ( opts!(
84+ "available_data_services" ,
85+ "Number of available data services (0-2)"
86+ ) ) ?;
8287
8388 registry. register ( Box :: new ( open_connections. clone ( ) ) ) ?;
8489 registry. register ( Box :: new ( received_proofs. clone ( ) ) ) ?;
@@ -96,6 +101,7 @@ impl BatcherMetrics {
96101 registry. register ( Box :: new ( cancel_create_new_task_duration. clone ( ) ) ) ?;
97102 registry. register ( Box :: new ( batcher_gas_cost_create_task_total. clone ( ) ) ) ?;
98103 registry. register ( Box :: new ( batcher_gas_cost_cancel_task_total. clone ( ) ) ) ?;
104+ registry. register ( Box :: new ( available_data_services. clone ( ) ) ) ?;
99105
100106 let metrics_route = warp:: path!( "metrics" )
101107 . and ( warp:: any ( ) . map ( move || registry. clone ( ) ) )
@@ -124,6 +130,7 @@ impl BatcherMetrics {
124130 cancel_create_new_task_duration,
125131 batcher_gas_cost_create_task_total,
126132 batcher_gas_cost_cancel_task_total,
133+ available_data_services,
127134 } )
128135 }
129136
0 commit comments