diff --git a/crates/rpc/src/metrics.rs b/crates/rpc/src/metrics.rs index 0214daa78..f609d10ad 100644 --- a/crates/rpc/src/metrics.rs +++ b/crates/rpc/src/metrics.rs @@ -98,6 +98,7 @@ impl RpcMetrics { } fn record_request_latency(method_name: String, latency: Duration) { - metrics::histogram!("rpc_request_latency", "method_name" => method_name).record(latency); + metrics::histogram!("rpc_request_latency", "method_name" => method_name) + .record(latency.as_millis() as f64); } } diff --git a/crates/task/src/grpc/metrics.rs b/crates/task/src/grpc/metrics.rs index 75b05fd69..9b72d6642 100644 --- a/crates/task/src/grpc/metrics.rs +++ b/crates/task/src/grpc/metrics.rs @@ -152,6 +152,6 @@ impl GrpcMetricsRecorder { // Record the latency of a request for a given method and service. fn record_request_latency(method_name: &str, scope: &str, latency: Duration) { - metrics::histogram!("grpc_request_latency", "method_name" => method_name.to_string(), "service" => scope.to_string()).record(latency) + metrics::histogram!("grpc_request_latency", "method_name" => method_name.to_string(), "service" => scope.to_string()).record(latency.as_millis() as f64) } }