mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
improve libp2p connected peer metrics (#4870)
* improve libp2p connected peer metrics * separate discv5 port from libp2p for NAT open * use metric family for DISCOVERY_BYTES * Merge branch 'unstable' of https://github.com/sigp/lighthouse into improve-metrics
This commit is contained in:
@@ -1003,11 +1003,13 @@ impl<TSpec: EthSpec> NetworkBehaviour for Discovery<TSpec> {
|
||||
}
|
||||
discv5::Event::SocketUpdated(socket_addr) => {
|
||||
info!(self.log, "Address updated"; "ip" => %socket_addr.ip(), "udp_port" => %socket_addr.port());
|
||||
metrics::inc_counter(&metrics::ADDRESS_UPDATE_COUNT);
|
||||
metrics::check_nat();
|
||||
// We have SOCKET_UPDATED messages. This occurs when discovery has a majority of
|
||||
// users reporting an external port and our ENR gets updated.
|
||||
// Which means we are able to do NAT traversal.
|
||||
metrics::set_gauge_vec(&metrics::NAT_OPEN, &["discv5"], 1);
|
||||
|
||||
// Discv5 will have updated our local ENR. We save the updated version
|
||||
// to disk.
|
||||
|
||||
if (self.update_ports.tcp4 && socket_addr.is_ipv4())
|
||||
|| (self.update_ports.tcp6 && socket_addr.is_ipv6())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user