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§
source§impl Clone for MetricsLayer
impl Clone for MetricsLayer
source§fn clone(&self) -> MetricsLayer
fn clone(&self) -> MetricsLayer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more