Skip to content

Commit

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

* Trace result in default `jsonrpsee` middleware

* `rpc_metrics::extra`

Co-authored-by: Bastian Köcher <git@kchr.de>

Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
2 people authored and ark0f committed Feb 27, 2023
1 parent 8918d64 commit 8e07960
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 8e07960

Please sign in to comment.