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

Add a metric to track number of RPC nodes requests #1026

Open
vpavlin opened this issue Dec 10, 2024 · 7 comments
Open

Add a metric to track number of RPC nodes requests #1026

vpavlin opened this issue Dec 10, 2024 · 7 comments
Labels
Client See https://miro.com/app/board/uXjVNZ03E-c=/ for details enhancement New feature or request

Comments

@vpavlin
Copy link
Contributor

vpavlin commented Dec 10, 2024


Is your feature request related to a problem? Please describe.
It would be good to understand how many RPC node requests a Codex node is doing - to know what kind of RPC node does one need (i.e. is a free tier RPC node enough based on the needed rate limit?)

Describe the solution you'd like
I'd like have a Prometheus metric tracking number of RPC node requests, so that we can see some averages over time

Describe alternatives you've considered
Not sure, feels likes a basic counter metric is the most straightforward way:)

Additional context
Add any other context or screenshots about the feature request here.

@gmega gmega added Client See https://miro.com/app/board/uXjVNZ03E-c=/ for details enhancement New feature or request labels Dec 11, 2024
@gmega
Copy link
Member

gmega commented Dec 11, 2024

Sounds like a reasonable request to me. I'll add to our backlog so we discuss it.

@AuHau
Copy link
Member

AuHau commented Dec 12, 2024

It is reasonable ask but won't be that easy to implement. If you are trying to understand how much RPC calls Codex node uses on avarage, I would say @veaceslavdoina give you some answer.

The reason why it won't be that easy is because we use abstraction library nim-ethers that abstract the interaction with the RPC provider. So technically we would need to add some hook system there that would expose the raw RPC calls.

Not sure if there is some other easy way here, but I can't think of any.

@vpavlin
Copy link
Contributor Author

vpavlin commented Dec 12, 2024

Hmm..that makes sense, sounds like the easiest way then is to add prometheus metrics to nim-ethers (or any other underlying library). I assumes from the persepective of performance analysis it could be also interesting to not only know number of calls, but also amount of data transferred etc. and that definitely belongs to that underlying library

@veaceslavdoina
Copy link
Contributor

If you are trying to understand how much RPC calls Codex node uses on avarage, I would say @veaceslavdoina give you some answer.

We are measuring that on RPC (Geth) side and for 10 Codex nodes we have the following right now
Image

@vpavlin
Copy link
Contributor Author

vpavlin commented Dec 12, 2024

So 300k req/day per node? So in theory a free tier on Quicknode (https://www.quicknode.com/pricing) offering 10M req/month should still work...cool:)

@vpavlin
Copy link
Contributor Author

vpavlin commented Dec 12, 2024

Not sure if there is some other easy way here, but I can't think of any.

What if someone added Prom metrics to https://github.com/status-im/nim-json-rpc for every other project to benefit? (Waku also uses RPC to sync RLN tree...)

@AuHau
Copy link
Member

AuHau commented Dec 12, 2024

Not sure if there is some other easy way here, but I can't think of any.

What if someone added Prom metrics to status-im/nim-json-rpc for every other project to benefit? (Waku also uses RPC to sync RLN tree...)

I doubt it being a library, they would like to have metrics (eq., HTTP server) as part of it. But for sure, there could be some supporting work done there, where there could be a callback that would be used every time there is an RPC call it would get a call and then it would be easy in the consuming apps to implement such a metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client See https://miro.com/app/board/uXjVNZ03E-c=/ for details enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants