@@ -5,8 +5,8 @@ use opentelemetry::{
55 global,
66 metrics:: {
77 AsyncInstrumentBuilder , Counter , Gauge , Histogram , HistogramBuilder , InstrumentBuilder ,
8- InstrumentProvider , MetricsError , ObservableCounter , ObservableGauge ,
9- ObservableUpDownCounter , Result , UpDownCounter ,
8+ InstrumentProvider , MetricResult , MetricsError , ObservableCounter , ObservableGauge ,
9+ ObservableUpDownCounter , UpDownCounter ,
1010 } ,
1111 otel_error, InstrumentationScope ,
1212} ;
@@ -493,11 +493,11 @@ impl InstrumentProvider for SdkMeter {
493493 }
494494}
495495
496- fn validate_instrument_config ( name : & str , unit : & Option < Cow < ' static , str > > ) -> Result < ( ) > {
496+ fn validate_instrument_config ( name : & str , unit : & Option < Cow < ' static , str > > ) -> MetricResult < ( ) > {
497497 validate_instrument_name ( name) . and_then ( |_| validate_instrument_unit ( unit) )
498498}
499499
500- fn validate_instrument_name ( name : & str ) -> Result < ( ) > {
500+ fn validate_instrument_name ( name : & str ) -> MetricResult < ( ) > {
501501 if name. is_empty ( ) {
502502 return Err ( MetricsError :: InvalidInstrumentConfiguration (
503503 INSTRUMENT_NAME_EMPTY ,
@@ -523,7 +523,7 @@ fn validate_instrument_name(name: &str) -> Result<()> {
523523 Ok ( ( ) )
524524}
525525
526- fn validate_instrument_unit ( unit : & Option < Cow < ' static , str > > ) -> Result < ( ) > {
526+ fn validate_instrument_unit ( unit : & Option < Cow < ' static , str > > ) -> MetricResult < ( ) > {
527527 if let Some ( unit) = unit {
528528 if unit. len ( ) > INSTRUMENT_UNIT_NAME_MAX_LENGTH {
529529 return Err ( MetricsError :: InvalidInstrumentConfiguration (
@@ -567,7 +567,7 @@ where
567567 description : Option < Cow < ' static , str > > ,
568568 unit : Option < Cow < ' static , str > > ,
569569 boundaries : Option < Vec < f64 > > ,
570- ) -> Result < ResolvedMeasures < T > > {
570+ ) -> MetricResult < ResolvedMeasures < T > > {
571571 let aggregators = self . measures ( kind, name, description, unit, boundaries) ?;
572572 Ok ( ResolvedMeasures {
573573 measures : aggregators,
@@ -581,7 +581,7 @@ where
581581 description : Option < Cow < ' static , str > > ,
582582 unit : Option < Cow < ' static , str > > ,
583583 boundaries : Option < Vec < f64 > > ,
584- ) -> Result < Vec < Arc < dyn internal:: Measure < T > > > > {
584+ ) -> MetricResult < Vec < Arc < dyn internal:: Measure < T > > > > {
585585 let inst = Instrument {
586586 name,
587587 description : description. unwrap_or_default ( ) ,
0 commit comments