Trait polkadot_node_metrics::metrics::Metrics
source · pub trait Metrics: Default + Clone {
// Required method
fn try_register(registry: &Registry) -> Result<Self, PrometheusError>;
// Provided method
fn register(registry: Option<&Registry>) -> Result<Self, PrometheusError> { ... }
}
Expand description
Subsystem- or job-specific Prometheus metrics.
Usually implemented as a wrapper for Option<ActualMetrics>
to ensure Default
bounds or as a dummy type ().
Prometheus metrics internally hold an Arc
reference, so cloning them is fine.
Required Methods§
sourcefn try_register(registry: &Registry) -> Result<Self, PrometheusError>
fn try_register(registry: &Registry) -> Result<Self, PrometheusError>
Try to register metrics in the Prometheus registry.
Provided Methods§
Object Safety§
This trait is not object safe.