What's the best way to add duration metrics to RPC requests? #1434
Unanswered
LesnyRumcajs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, I'd like to add duration metrics to an existing RPC server (which is based mostly at one of the examples here, apparently https://github.com/ChainSafe/forest/blob/e8420e42ad7b453c3ec72bbf62bdac692e00bc44/src/rpc/mod.rs#L380).
A Prometheus server is already there. Now, what is unclear to me is where should I put the metric logic. The API is a bit, quoting the example, weird. Should it be put roughly before the RPC middleweare is created, e.g.,
timer.start()
and move it to thesession_close
task? Will this report correct time?At the end of the day, I'd like to have a bunch of metrics that show me:
Beta Was this translation helpful? Give feedback.
All reactions