Struct opendal::layers::MetricsLayer
source · pub struct MetricsLayer;
Expand description
MetricsLayer will add metrics for OpenDAL.
Metrics
opendal_requests_total
: Total request numbers.opendal_requests_duration_seconds
: Request duration seconds.opendal_errors_total
: Total error numbers.opendal_bytes_total
: bytes read/write from/to underlying storage.
Labels
metrics will carry the following labels
service
: Service name fromScheme
operation
: Operation name fromOperation
error
:ErrorKind
received by requests
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