File tree Expand file tree Collapse file tree 8 files changed +10
-10
lines changed
examples/metrics-basic/src
opentelemetry-otlp/src/exporter Expand file tree Collapse file tree 8 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ async fn main() {
147147 Ok ( _) => println ! ( "MeterProvider shutdown successfully" ) ,
148148 Err ( e) => {
149149 match e {
150- opentelemetry_sdk:: error:: ShutdownError :: Failed ( e) => {
150+ opentelemetry_sdk:: error:: ShutdownError :: InternalFailure ( e) => {
151151 // This indicates some failure during shutdown.
152152 // Not much to do here, but log the error.
153153 // So users at least know something went wrong,
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ impl MetricsClient for OtlpHttpClient {
4848 self . client
4949 . lock ( )
5050 . map_err ( |e| {
51- ShutdownError :: Failed ( format ! ( "Internal Error. Failed to acquire lock: {}" , e) )
51+ ShutdownError :: InternalFailure ( format ! ( "Internal Error. Failed to acquire lock: {}" , e) )
5252 } ) ?
5353 . take ( ) ;
5454
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ impl MetricsClient for TonicMetricsClient {
9494 self . inner
9595 . lock ( )
9696 . map_err ( |e| {
97- ShutdownError :: Failed ( format ! ( "Internal Error. Failed to acquire lock: {}" , e) )
97+ ShutdownError :: InternalFailure ( format ! ( "Internal Error. Failed to acquire lock: {}" , e) )
9898 } ) ?
9999 . take ( ) ;
100100
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub enum ShutdownError {
2424 /// Shutdown failed with an error.
2525 /// This error is returned when the shutdown process failed with an error.
2626 #[ error( "Shutdown failed: {0}" ) ]
27- Failed ( String ) ,
27+ InternalFailure ( String ) ,
2828}
2929
3030/// A specialized `Result` type for Shutdown operations.
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ impl MetricReader for ManualReader {
112112 /// Closes any connections and frees any resources used by the reader.
113113 fn shutdown ( & self ) -> ShutdownResult {
114114 let mut inner = self . inner . lock ( ) . map_err ( |e| {
115- ShutdownError :: Failed ( format ! ( "Internal Error. Failed to acquire lock: {}" , e) )
115+ ShutdownError :: InternalFailure ( format ! ( "Internal Error. Failed to acquire lock: {}" , e) )
116116 } ) ?;
117117
118118 // Any future call to collect will now return an error.
Original file line number Diff line number Diff line change @@ -405,22 +405,22 @@ impl PeriodicReaderInner {
405405 let ( response_tx, response_rx) = mpsc:: channel ( ) ;
406406 self . message_sender
407407 . send ( Message :: Shutdown ( response_tx) )
408- . map_err ( |e| ShutdownError :: Failed ( e. to_string ( ) ) ) ?;
408+ . map_err ( |e| ShutdownError :: InternalFailure ( e. to_string ( ) ) ) ?;
409409
410410 // TODO: Make this timeout configurable.
411411 match response_rx. recv_timeout ( Duration :: from_secs ( 5 ) ) {
412412 Ok ( response) => {
413413 if response {
414414 Ok ( ( ) )
415415 } else {
416- Err ( ShutdownError :: Failed ( "Failed to shutdown" . into ( ) ) )
416+ Err ( ShutdownError :: InternalFailure ( "Failed to shutdown" . into ( ) ) )
417417 }
418418 }
419419 Err ( mpsc:: RecvTimeoutError :: Timeout ) => {
420420 Err ( ShutdownError :: Timeout ( Duration :: from_secs ( 5 ) ) )
421421 }
422422 Err ( mpsc:: RecvTimeoutError :: Disconnected ) => {
423- Err ( ShutdownError :: Failed ( "Failed to shutdown" . into ( ) ) )
423+ Err ( ShutdownError :: InternalFailure ( "Failed to shutdown" . into ( ) ) )
424424 }
425425 }
426426 }
Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ impl Pipelines {
661661 if errs. is_empty ( ) {
662662 Ok ( ( ) )
663663 } else {
664- Err ( crate :: error:: ShutdownError :: Failed ( format ! ( "{errs:?}" ) ) )
664+ Err ( crate :: error:: ShutdownError :: InternalFailure ( format ! ( "{errs:?}" ) ) )
665665 }
666666 }
667667}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ impl MetricReader for TestMetricReader {
4848 let mut is_shutdown = self . is_shutdown . lock ( ) . unwrap ( ) ;
4949 * is_shutdown = true ;
5050 }
51- result. map_err ( |e| crate :: error:: ShutdownError :: Failed ( e. to_string ( ) ) )
51+ result. map_err ( |e| crate :: error:: ShutdownError :: InternalFailure ( e. to_string ( ) ) )
5252 }
5353
5454 fn temporality ( & self , _kind : InstrumentKind ) -> Temporality {
You can’t perform that action at this time.
0 commit comments