feat(ethexe-rpc): Metrics middleware for RPC methods#5371
feat(ethexe-rpc): Metrics middleware for RPC methods#5371ecol-master wants to merge 94 commits intomasterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a comprehensive set of changes primarily focused on enhancing the RPC layer with metrics and significantly refactoring the injected transaction and promise handling. The core intent is to improve the efficiency and observability of RPC communications, particularly for transaction promises, by introducing compact promise structures and a dedicated management system. These changes streamline the data flow between RPC, compute, consensus, and network services, ensuring more efficient promise propagation and better resource utilization. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a more robust and centralized metrics collection system for the RPC server, replacing manual increments with a middleware-based approach. The new RpcMetricsLayer and RpcMetricsRegistry allow for automated tracking of call counts, latency, and in-flight requests for specified RPC methods. Feedback focuses on preventing potential metric leaks during future cancellation, resolving module naming conflicts, and expanding the default set of tracked methods to ensure comprehensive API monitoring.
…//github.com/gear-tech/gear into kd/reopen/producer-distribute-promise-hashes
…//github.com/gear-tech/gear into kd/reopen/producer-distribute-promise-hashes
…/rpc-metrics-middleware
|
@claude review |
|
Claude finished @ecol-master's task in 3m 48s —— View job Code ReviewThis PR replaces per-method manual counters with a generic Tower middleware layer that intercepts all jsonrpsee method calls and records high: File: If the Fix: wrap the decrement in a RAII guard rather than relying on let future = self.service.call(request);
Box::pin(async move {
metrics.on_incoming_request();
// Guard ensures decrement even on cancellation.
let _guard = scopeguard::guard((), |_| metrics.calls_in_flight.decrement(1));
let started_at = Instant::now();
let response = future.await;
metrics.on_outgoing_response(started_at, &response); // remove calls_in_flight decrement from here
response
})medium: inner File: The inner module name conflicts with the medium: File:
low: inconsistent tracing style in File:
Overall the middleware approach is the right design. The cancellation-safety gap with |
|
@claude review-delta |
|
Claude finished @ecol-master's task in 1m 56s —— View job Delta ReviewReviewing changes since the previous review. The relevant commit is Fixed
Still Open medium: inner The medium:
low: inconsistent tracing style in
New observation The |
Closes: #5387
@gear-tech/dev