feat(ethexe-rpc): Metrics middleware for RPC methods#5371
feat(ethexe-rpc): Metrics middleware for RPC methods#5371ecol-master wants to merge 96 commits intomasterfrom
Conversation
…//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