From 5b9ff9213fe374a462f346b62371a1c26da074dd Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 16 Oct 2023 01:06:16 +0200 Subject: [PATCH] cave/activitypub/send: remove histogram instrumentation --- cave/src/activitypub/send.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cave/src/activitypub/send.rs b/cave/src/activitypub/send.rs index c383558..5344af1 100644 --- a/cave/src/activitypub/send.rs +++ b/cave/src/activitypub/send.rs @@ -1,9 +1,8 @@ use std::{ sync::Arc, - time::{Instant, SystemTime}, + time::SystemTime, }; use http::StatusCode; -use metrics::histogram; use serde::Serialize; use sigh::{PrivateKey, SigningConfig, alg::RsaSha256}; use super::{digest, error::Error}; @@ -43,20 +42,14 @@ pub async fn send_raw( .header("digest", digest_header) .body(body.as_ref().clone()) .map_err(Error::HttpReq)?; - let t1 = Instant::now(); SigningConfig::new(RsaSha256, private_key, key_id) .sign(&mut req)?; - let t2 = Instant::now(); let req: reqwest::Request = req.try_into()?; let res = client.execute(req) .await?; - let t3 = Instant::now(); - histogram!("relay_http_request_duration", t2 - t1); if res.status() >= StatusCode::OK && res.status() < StatusCode::MULTIPLE_CHOICES { - histogram!("relay_http_response_duration", t3 - t2, "res" => "ok", "host" => host); Ok(()) } else { - histogram!("relay_http_response_duration", t3 - t2, "res" => "err", "host" => host); tracing::error!("send_raw {} response HTTP {}", url, res.status()); let response = res.text().await?; Err(Error::Response(response))