refactor: swap existing metrics for THE NEW WAY

pull/24376/head
Edd Robinson 2021-04-21 22:51:56 +01:00 committed by kodiakhq[bot]
parent cd7df48718
commit 59282bce6e
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
use crate::commands::run::{Config, ObjectStore as ObjStoreOpt}; use crate::commands::run::{Config, ObjectStore as ObjStoreOpt};
use futures::{future::FusedFuture, pin_mut, FutureExt}; use futures::{future::FusedFuture, pin_mut, FutureExt};
use hyper::server::conn::AddrIncoming; use hyper::server::conn::AddrIncoming;
use metrics::MetricRegistry;
use object_store::{ use object_store::{
self, aws::AmazonS3, azure::MicrosoftAzure, gcp::GoogleCloudStorage, ObjectStore, self, aws::AmazonS3, azure::MicrosoftAzure, gcp::GoogleCloudStorage, ObjectStore,
}; };

View File

@ -423,6 +423,9 @@ where
let path = req.uri().path().to_string(); let path = req.uri().path().to_string();
let server = Arc::clone(&req.data::<Arc<AppServer<M>>>().expect("server state")); let server = Arc::clone(&req.data::<Arc<AppServer<M>>>().expect("server state"));
// TODO - metrics. Implement a macro/something that will catch all the
// early returns.
// TODO(edd): figure out best way of catching all errors in this observation. // TODO(edd): figure out best way of catching all errors in this observation.
let obs = server.metrics.http_requests.observation(); // instrument request let obs = server.metrics.http_requests.observation(); // instrument request