diff --git a/opentelemetry-stackdriver/src/lib.rs b/opentelemetry-stackdriver/src/lib.rs index 17ad7f4891..3a837ce88d 100644 --- a/opentelemetry-stackdriver/src/lib.rs +++ b/opentelemetry-stackdriver/src/lib.rs @@ -96,7 +96,9 @@ impl StackDriverExporter { impl SpanExporter for StackDriverExporter { fn export(&mut self, batch: Vec) -> BoxFuture<'static, ExportResult> { match self.tx.try_send(batch) { - Err(e) => Box::pin(std::future::ready(Err(e.into()))), + Err(e) => Box::pin(std::future::ready(Err(TraceError::Other(Box::new( + e.into_send_error(), + ))))), Ok(()) => { self.pending_count.fetch_add(1, Ordering::Relaxed); Box::pin(std::future::ready(Ok(()))) diff --git a/opentelemetry/CHANGELOG.md b/opentelemetry/CHANGELOG.md index 6068a24c53..83fcb4fb55 100644 --- a/opentelemetry/CHANGELOG.md +++ b/opentelemetry/CHANGELOG.md @@ -27,6 +27,9 @@ This release should been seen as 1.0-rc3 following 1.0-rc2 in v0.19.0. Refer to - Drop include_trace_context parameter from Logs API/SDK. [#1133](https://github.com/open-telemetry/opentelemetry-rust/issues/1133) - Synchronous instruments no longer accepts `Context` while reporting measurements. [#1076](https://github.com/open-telemetry/opentelemetry-rust/pull/1076). +- Fallible conversions from `futures-channel` error types to `LogError` and + `TraceError` removed. + [#1201](https://github.com/open-telemetry/opentelemetry-rust/issues/1201) ### Fixed diff --git a/opentelemetry/Cargo.toml b/opentelemetry/Cargo.toml index 20efa6c29e..6d9be84551 100644 --- a/opentelemetry/Cargo.toml +++ b/opentelemetry/Cargo.toml @@ -21,7 +21,6 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -futures-channel = "0.3" futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] } indexmap = "2.0" once_cell = "1.12.0" diff --git a/opentelemetry/src/logs/mod.rs b/opentelemetry/src/logs/mod.rs index dae7a3c8d4..c48cf5c1e1 100644 --- a/opentelemetry/src/logs/mod.rs +++ b/opentelemetry/src/logs/mod.rs @@ -1,7 +1,6 @@ //! # OpenTelemetry Logs API use crate::ExportError; -use futures_channel::{mpsc::TrySendError, oneshot::Canceled}; use std::time::Duration; use thiserror::Error; @@ -42,18 +41,6 @@ where } } -impl From> for LogError { - fn from(err: TrySendError) -> Self { - LogError::Other(Box::new(err.into_send_error())) - } -} - -impl From for LogError { - fn from(err: Canceled) -> Self { - LogError::Other(Box::new(err)) - } -} - impl From for LogError { fn from(err_msg: String) -> Self { LogError::Other(Box::new(Custom(err_msg))) diff --git a/opentelemetry/src/trace/mod.rs b/opentelemetry/src/trace/mod.rs index b27fcd3aa5..2f07eafdec 100644 --- a/opentelemetry/src/trace/mod.rs +++ b/opentelemetry/src/trace/mod.rs @@ -162,7 +162,6 @@ //! some_work().with_context(Context::current_with_span(span)); //! ``` -use futures_channel::{mpsc::TrySendError, oneshot::Canceled}; use std::borrow::Cow; use std::time; use thiserror::Error; @@ -218,18 +217,6 @@ where } } -impl From> for TraceError { - fn from(err: TrySendError) -> Self { - TraceError::Other(Box::new(err.into_send_error())) - } -} - -impl From for TraceError { - fn from(err: Canceled) -> Self { - TraceError::Other(Box::new(err)) - } -} - impl From for TraceError { fn from(err_msg: String) -> Self { TraceError::Other(Box::new(Custom(err_msg)))