aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-22 14:52:41 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 10:53:36 +0100
commit2a5609b292de019085f93a79b7b73f7a8341bf51 (patch)
tree7175cbeb1fc4eabcec936ccb8aee2945a92b1c60 /src/rpc
parent818daa5c786813fdf50fecb6022e29b18e509b62 (diff)
downloadgarage-2a5609b292de019085f93a79b7b73f7a8341bf51.tar.gz
garage-2a5609b292de019085f93a79b7b73f7a8341bf51.zip
Add metrics to API endpoint
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rpc_helper.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc/rpc_helper.rs b/src/rpc/rpc_helper.rs
index f8bef47f..099c6429 100644
--- a/src/rpc/rpc_helper.rs
+++ b/src/rpc/rpc_helper.rs
@@ -1,6 +1,6 @@
//! Contain structs related to making RPCs
use std::sync::Arc;
-use std::time::{Duration};
+use std::time::Duration;
use futures::future::join_all;
use futures::stream::futures_unordered::FuturesUnordered;
@@ -134,7 +134,7 @@ impl RpcHelper {
M: Rpc<Response = Result<S, Error>>,
H: EndpointHandler<M>,
{
- let metric_tags = [KeyValue::new("endpoint", endpoint.path().to_string())];
+ let metric_tags = [KeyValue::new("rpc_endpoint", endpoint.path().to_string())];
let msg_size = rmp_to_vec_all_named(&msg)?.len() as u32;
let permit = self
@@ -147,7 +147,8 @@ impl RpcHelper {
self.0.metrics.rpc_counter.add(1, &metric_tags);
let node_id = to.into();
- let rpc_call = endpoint.call(&node_id, msg, strat.rs_priority)
+ let rpc_call = endpoint
+ .call(&node_id, msg, strat.rs_priority)
.record_duration(&self.0.metrics.rpc_duration, &metric_tags);
select! {