fix(rpc middleware): fix is_error bug (#11951)

* fix(rpc middleware): fix `is_error` bug

* Update client/rpc-servers/src/middleware.rs
This commit is contained in:
Niklas Adolfsson authored and GitHub committed 2022-08-02 07:06:36 +00:00
1 parent 14ca731ac4
commit 795afe2747
1 file changed
+3 -1
@@ -176,7 +176,9 @@ impl Middleware for RpcMiddleware {
.with_label_values(&[
self.transport_label,
name,
if success { "true" } else { "false" },
// the label "is_error", so `success` should be regarded as false
// and vice-versa to be registrered correctly.
if success { "false" } else { "true" },
])
.inc();
}