Skip to content

Conversation

@MegaRedHand
Copy link
Contributor

This PR adds the "Network Metrics" from leanMetrics:

  • lean_connected_peers
  • lean_peer_connection_events_total
  • lean_peer_disconnection_events_total

Add the following metrics from the leanMetrics specification:
- lean_connected_peers: Gauge with client label tracking connected peer count
- lean_peer_connection_events_total: Counter with direction and result labels
- lean_peer_disconnection_events_total: Counter with direction and reason labels

Connection events are tracked in the p2p event loop by handling
SwarmEvent::ConnectionEstablished, SwarmEvent::ConnectionClosed,
SwarmEvent::OutgoingConnectionError, and SwarmEvent::IncomingConnectionError.
@MegaRedHand MegaRedHand merged commit 6192425 into main Jan 23, 2026
2 checks passed
@MegaRedHand MegaRedHand deleted the peer-connection-metrics branch January 23, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants