diff --git a/libp2p/protocols/pubsub/pubsub.nim b/libp2p/protocols/pubsub/pubsub.nim index daa05d1..cab34a2 100644 --- a/libp2p/protocols/pubsub/pubsub.nim +++ b/libp2p/protocols/pubsub/pubsub.nim @@ -144,6 +144,10 @@ proc getOrCreatePeer(p: PubSub, p.peers[peer.id] = peer peer.observers = p.observers + + # metrics + libp2p_pubsub_peers.set(p.peers.len.int64) + return peer method handleConn*(p: PubSub,