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

Good practice advice: Adding Prometheus to a JsonRpsee server #1328

Open
Eikix opened this issue Mar 22, 2024 · 1 comment
Open

Good practice advice: Adding Prometheus to a JsonRpsee server #1328

Eikix opened this issue Mar 22, 2024 · 1 comment

Comments

@Eikix
Copy link

Eikix commented Mar 22, 2024

Hi team,

At Kakarot, we're using JsonRpsee to build our Ethereum RPC layer. As our testnet is imminent, we're looking to add Prometheus to our RPC.

Do you recommend a preferred way to do it? We're currently reusing the code from Substrate that adds Prometheus to the JsonRpc server. I'm wondering if there is a way you'd recommend doing it, I suspect many people using jsonrpsee in prod had to ask themselves this question.

Happy to open a PR and add a example in the examples folder with the outcome of this discussion!

Thanks for your help (and cool software).

@niklasad1
Copy link
Member

Hey @Eikix

Good question, I think the easiest way is to write them as RpcMiddleware as we have done in substrate but it's tricky to have connection stats without using the low-level server API.

Would be great if you could add an example for prometheus metrics or create a discussion thread at GitHub, thanks

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

No branches or pull requests

2 participants