@@ -16,7 +16,7 @@ use crate::NoExporterBuilderSet;
1616
1717use async_trait:: async_trait;
1818use core:: fmt;
19- use opentelemetry:: metrics:: Result ;
19+ use opentelemetry:: metrics:: MetricResult ;
2020
2121use opentelemetry_sdk:: metrics:: {
2222 data:: { ResourceMetrics , Temporality } ,
@@ -77,15 +77,15 @@ impl<C> MetricsExporterBuilder<C> {
7777
7878#[ cfg( feature = "grpc-tonic" ) ]
7979impl MetricsExporterBuilder < TonicExporterBuilderSet > {
80- pub fn build ( self ) -> Result < MetricsExporter > {
80+ pub fn build ( self ) -> MetricResult < MetricsExporter > {
8181 let exporter = self . client . 0 . build_metrics_exporter ( self . temporality ) ?;
8282 Ok ( exporter)
8383 }
8484}
8585
8686#[ cfg( any( feature = "http-proto" , feature = "http-json" ) ) ]
8787impl MetricsExporterBuilder < HttpExporterBuilderSet > {
88- pub fn build ( self ) -> Result < MetricsExporter > {
88+ pub fn build ( self ) -> MetricResult < MetricsExporter > {
8989 let exporter = self . client . 0 . build_metrics_exporter ( self . temporality ) ?;
9090 Ok ( exporter)
9191 }
@@ -122,8 +122,8 @@ impl HasHttpConfig for MetricsExporterBuilder<HttpExporterBuilderSet> {
122122/// An interface for OTLP metrics clients
123123#[ async_trait]
124124pub trait MetricsClient : fmt:: Debug + Send + Sync + ' static {
125- async fn export ( & self , metrics : & mut ResourceMetrics ) -> Result < ( ) > ;
126- fn shutdown ( & self ) -> Result < ( ) > ;
125+ async fn export ( & self , metrics : & mut ResourceMetrics ) -> MetricResult < ( ) > ;
126+ fn shutdown ( & self ) -> MetricResult < ( ) > ;
127127}
128128
129129/// Export metrics in OTEL format.
@@ -140,16 +140,16 @@ impl Debug for MetricsExporter {
140140
141141#[ async_trait]
142142impl PushMetricsExporter for MetricsExporter {
143- async fn export ( & self , metrics : & mut ResourceMetrics ) -> Result < ( ) > {
143+ async fn export ( & self , metrics : & mut ResourceMetrics ) -> MetricResult < ( ) > {
144144 self . client . export ( metrics) . await
145145 }
146146
147- async fn force_flush ( & self ) -> Result < ( ) > {
147+ async fn force_flush ( & self ) -> MetricResult < ( ) > {
148148 // this component is stateless
149149 Ok ( ( ) )
150150 }
151151
152- fn shutdown ( & self ) -> Result < ( ) > {
152+ fn shutdown ( & self ) -> MetricResult < ( ) > {
153153 self . client . shutdown ( )
154154 }
155155
0 commit comments