From bf141f6e6516289794bedfac3e82908965166e84 Mon Sep 17 00:00:00 2001 From: SionoiS Date: Tue, 23 Jul 2024 10:39:38 -0400 Subject: [PATCH 1/3] add back metrics --- waku/discovery/waku_discv5.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/waku/discovery/waku_discv5.nim b/waku/discovery/waku_discv5.nim index 75e15b9d7f..a5231779f6 100644 --- a/waku/discovery/waku_discv5.nim +++ b/waku/discovery/waku_discv5.nim @@ -211,6 +211,8 @@ proc findRandomPeers*( elif wd.predicate.isSome(): discoveredRecords = discoveredRecords.filter(wd.predicate.get()) + waku_discv5_discovered.inc(discoveredRecords.len) + return discoveredRecords proc searchLoop(wd: WakuDiscoveryV5) {.async.} = @@ -233,6 +235,7 @@ proc searchLoop(wd: WakuDiscoveryV5) {.async.} = let peerInfo = record.toRemotePeerInfo().valueOr: ## in case of error, we keep track of it for debugging purposes wrongRecordsReasons.add(($record, $error)) + waku_discv5_errors.inc() continue discoveredPeers.add(peerInfo) From c999493b13bfb3e541c2508f824754b1f05d9ba5 Mon Sep 17 00:00:00 2001 From: SionoiS Date: Tue, 23 Jul 2024 11:13:45 -0400 Subject: [PATCH 2/3] more metrics --- waku/node/peer_manager/peer_manager.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/waku/node/peer_manager/peer_manager.nim b/waku/node/peer_manager/peer_manager.nim index f4ef5e1bb3..9c5c31df1e 100644 --- a/waku/node/peer_manager/peer_manager.nim +++ b/waku/node/peer_manager/peer_manager.nim @@ -36,6 +36,7 @@ declarePublicGauge waku_streams_peers, declarePublicGauge waku_peer_store_size, "Number of peers managed by the peer store" declarePublicGauge waku_service_peers, "Service peer protocol and multiaddress ", labels = ["protocol", "peerId"] +declarePublicGauge waku_total_unique_peers, "total number of unique peers" logScope: topics = "waku node peer_manager" @@ -141,6 +142,8 @@ proc addPeer*( trace "Adding peer to manager", peerId = remotePeerInfo.peerId, addresses = remotePeerInfo.addrs + waku_total_unique_peers.inc() + pm.peerStore[AddressBook][remotePeerInfo.peerId] = remotePeerInfo.addrs pm.peerStore[KeyBook][remotePeerInfo.peerId] = remotePeerInfo.publicKey pm.peerStore[SourceBook][remotePeerInfo.peerId] = origin From 58dbea7d74d7acb18f9be70b7d7ee9866608dabd Mon Sep 17 00:00:00 2001 From: Simon-Pierre Vivier Date: Fri, 26 Jul 2024 15:35:19 -0400 Subject: [PATCH 3/3] Update waku/discovery/waku_discv5.nim Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> --- waku/discovery/waku_discv5.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waku/discovery/waku_discv5.nim b/waku/discovery/waku_discv5.nim index a5231779f6..5841b56859 100644 --- a/waku/discovery/waku_discv5.nim +++ b/waku/discovery/waku_discv5.nim @@ -235,7 +235,7 @@ proc searchLoop(wd: WakuDiscoveryV5) {.async.} = let peerInfo = record.toRemotePeerInfo().valueOr: ## in case of error, we keep track of it for debugging purposes wrongRecordsReasons.add(($record, $error)) - waku_discv5_errors.inc() + waku_discv5_errors.inc(labelValues = [$error]) continue discoveredPeers.add(peerInfo)