@@ -18,6 +18,7 @@ use tracing::Span;
1818use zebra_chain:: { parameters:: Network , serialization:: DateTime32 } ;
1919
2020use crate :: {
21+ connection_metrics:: network_kind_label,
2122 constants:: { self , ADDR_RESPONSE_LIMIT_DENOMINATOR , MAX_ADDRS_IN_MESSAGE } ,
2223 meta_addr:: MetaAddrChange ,
2324 protocol:: external:: { canonical_peer_addr, canonical_socket_addr} ,
@@ -754,15 +755,20 @@ impl AddressBook {
754755 let _ = self . address_metrics_tx . send ( m) ;
755756
756757 // TODO: rename to address_book.[state_name]
757- metrics:: gauge!( "candidate_set.responded" ) . set ( m. responded as f64 ) ;
758- metrics:: gauge!( "candidate_set.gossiped" ) . set ( m. never_attempted_gossiped as f64 ) ;
759- metrics:: gauge!( "candidate_set.failed" ) . set ( m. failed as f64 ) ;
760- metrics:: gauge!( "candidate_set.pending" ) . set ( m. attempt_pending as f64 ) ;
758+ let network = network_kind_label ( & self . network ) ;
759+ metrics:: gauge!( "candidate_set.responded" , "network" => network) . set ( m. responded as f64 ) ;
760+ metrics:: gauge!( "candidate_set.gossiped" , "network" => network)
761+ . set ( m. never_attempted_gossiped as f64 ) ;
762+ metrics:: gauge!( "candidate_set.failed" , "network" => network) . set ( m. failed as f64 ) ;
763+ metrics:: gauge!( "candidate_set.pending" , "network" => network)
764+ . set ( m. attempt_pending as f64 ) ;
761765
762766 // TODO: rename to address_book.responded.recently_live
763- metrics:: gauge!( "candidate_set.recently_live" ) . set ( m. recently_live as f64 ) ;
767+ metrics:: gauge!( "candidate_set.recently_live" , "network" => network)
768+ . set ( m. recently_live as f64 ) ;
764769 // TODO: rename to address_book.responded.stopped_responding
765- metrics:: gauge!( "candidate_set.disconnected" ) . set ( m. recently_stopped_responding as f64 ) ;
770+ metrics:: gauge!( "candidate_set.disconnected" , "network" => network)
771+ . set ( m. recently_stopped_responding as f64 ) ;
766772
767773 std:: mem:: drop ( _guard) ;
768774 self . log_metrics ( & m, instant_now) ;
0 commit comments