juno
juno copied to clipboard
Active rpc connections metric
Issue
Juno now has persistent connections (eg. ws conns) with not much info about them. It would be nice if It was known to user how many of them there are.
Implementation
Do you have ideas regarding the implementation of this feature? yes Are you willing to implement this feature? yes
Scope:
- Using gauge for tracking the amount of connections
- Extending
NewRequestListener
withOnNewConnection(conn net.Conn)
andOnDisconnect(conn net.Conn)
. - Implementing the logic in each jsonrpc handler.
Additional Information:
-
OnNewConnection(conn net.Conn)
andOnDisconnect(conn net.Conn)
would be a nice place for uniform logging eg. ("Accepted connection", "conn", conn.RemoteAddr()) -
OnNewConnection(conn net.Conn)
could be further extended intoOnNewConnection(conn net.Conn) net.Conn
which would enable tracking how much bytes were sent/recv.
Very nice idea.
Implementing the logic in each rpc handler.
We would only need to implement this in the websocket transport in the jsonrpc
package, correct? No need to modify the higher-level rpc
package handlers.
yes, I meant jsonrpc