Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Trace response payload in default jsonrpsee middleware (#12886)
Browse files Browse the repository at this point in the history
* Trace result in default `jsonrpsee` middleware

* `rpc_metrics::extra`

Co-authored-by: Bastian Köcher <[email protected]>

Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
tgmichel and bkchr authored Dec 9, 2022
1 parent 9931220 commit 15cfd9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/rpc-servers/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ impl RpcMiddleware {
}

/// Called once the JSON-RPC request is finished and response is sent to the output buffer.
fn on_response(&self, _result: &str, started_at: std::time::Instant) {
fn on_response(&self, result: &str, started_at: std::time::Instant) {
log::trace!(target: "rpc_metrics", "[{}] on_response started_at={:?}", self.transport_label, started_at);
log::trace!(target: "rpc_metrics::extra", "[{}] result={:?}", self.transport_label, result);
self.metrics.requests_finished.with_label_values(&[self.transport_label]).inc();
}
}
Expand Down

0 comments on commit 15cfd9c

Please sign in to comment.