-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat(middleware): create a generic middleware to collect method metrics. #804
base: feat/v0.4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also be able to implement this for Alloy in the provider
crate
0480067
to
868327d
Compare
yup I will do that in other pr. git won't allow me to split commits into multiple prs. |
What do you mean? You should be able to add it to this PR? |
I can - but prefer small prs. |
36b3579
to
a28eb59
Compare
} | ||
_ => { | ||
// can't extract method name for batch. | ||
"unknown".to_string() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets call this "batch"
use jsonrpsee::types::Request; | ||
use rundler_types::task::traits::RequestExtractor; | ||
|
||
#[derive(Copy)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You likely need to derive Clone here as well
} | ||
} | ||
|
||
impl<S, T, Request> Service<Request> for MetricsMiddleware<S, T, Request> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A feature that I'm realizing now that this is missing is related to response codes. Our existing ethers based metrics layer would extract those:
let http = match http_code { |
Lets do this in a follow up, but we may need to also add a ResponseExtractor
that can get the code out and then have that be part of the metrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind creating a follow up ticket and assigning it to milestone v0.4 and yourself?
Few last comments, but other than that LGTM! Will ✅ after the small updates. |
[Closes/Fixes] #787
Proposed Changes