Struct opendal::layers::MetricsLayer
source · pub struct MetricsLayer;
Expand description
MetricsLayer will add metrics for OpenDAL.
Metrics
opendal_requests_total
: Total requests numbers;opendal_requests_duration_seconds
: Request duration seconds;- NOTE: this metric tracks the duration of the OpenDAL’s function call, not the underlying http request duration.
opendal_failures_total
: number of unexpected errors encountered, like network broken;opendal_errors_total
: number of expected errors failures encountered, like file not found;opendal_bytes_read_total
: bytes read from underlying storage;opendal_bytes_write_total
: bytes write to underlying storage.
Labels
Most metrics will carry the following labels
Examples
use anyhow::Result;
use opendal::layers::MetricsLayer;
use opendal::Operator;
use opendal::Scheme;
let _ = Operator::from_env(Scheme::Fs)
.expect("must init")
.layer(MetricsLayer);
Trait Implementations
sourceimpl Clone for MetricsLayer
impl Clone for MetricsLayer
sourcefn clone(&self) -> MetricsLayer
fn clone(&self) -> MetricsLayer
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MetricsLayer
impl Debug for MetricsLayer
sourceimpl Layer for MetricsLayer
impl Layer for MetricsLayer
impl Copy for MetricsLayer
Auto Trait Implementations
impl RefUnwindSafe for MetricsLayer
impl Send for MetricsLayer
impl Sync for MetricsLayer
impl Unpin for MetricsLayer
impl UnwindSafe for MetricsLayer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more