mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-13 07:46:51 +00:00
Add metrics to web endpoint
This commit is contained in:
+8
-1
@@ -1,8 +1,9 @@
|
||||
use std::time::SystemTime;
|
||||
|
||||
use futures::{future::BoxFuture, Future, FutureExt};
|
||||
use rand::Rng;
|
||||
|
||||
use opentelemetry::{metrics::*, KeyValue};
|
||||
use opentelemetry::{metrics::*, trace::TraceId, KeyValue};
|
||||
|
||||
pub trait RecordDuration<'a>: 'a {
|
||||
type Output;
|
||||
@@ -48,3 +49,9 @@ where
|
||||
.boxed()
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
|
||||
pub fn gen_trace_id() -> TraceId {
|
||||
rand::thread_rng().gen::<[u8; 16]>().into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user