Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active rpc connections metric #1512

Open
Exca-DK opened this issue Dec 2, 2023 · 2 comments
Open

Active rpc connections metric #1512

Exca-DK opened this issue Dec 2, 2023 · 2 comments
Labels
Metrics Features or changes related to metrics RPC JSON RPC API

Comments

@Exca-DK
Copy link
Contributor

Exca-DK commented Dec 2, 2023

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 with OnNewConnection(conn net.Conn) and OnDisconnect(conn net.Conn).
  • Implementing the logic in each jsonrpc handler.

Additional Information:

  • OnNewConnection(conn net.Conn) and OnDisconnect(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 into OnNewConnection(conn net.Conn) net.Conn which would enable tracking how much bytes were sent/recv.
@Exca-DK Exca-DK changed the title Active connections metric Active rpc connections metric Dec 2, 2023
@joshklop joshklop added RPC JSON RPC API Metrics Features or changes related to metrics labels Dec 2, 2023
@joshklop
Copy link
Contributor

joshklop commented Dec 2, 2023

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.

@Exca-DK
Copy link
Contributor Author

Exca-DK commented Dec 3, 2023

yes, I meant jsonrpc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metrics Features or changes related to metrics RPC JSON RPC API
Projects
None yet
Development

No branches or pull requests

2 participants