opentelemetry_sdk/metrics/
error.rs1use std::result;
2use std::sync::PoisonError;
3use thiserror::Error;
4
5pub(crate) type MetricResult<T> = result::Result<T, MetricError>;
7
8#[derive(Error, Debug)]
10pub(crate) enum MetricError {
11 #[error("Metrics error: {0}")]
13 Other(String),
14 #[error("Config error {0}")]
16 Config(String),
17 #[error("Invalid instrument configuration: {0}")]
21 InvalidInstrumentConfiguration(&'static str),
22}
23
24impl<T> From<PoisonError<T>> for MetricError {
25 fn from(err: PoisonError<T>) -> Self {
26 MetricError::Other(err.to_string())
27 }
28}