Skip to content

Commit 08119c4

Browse files
authored
opentelemetry crate no longer depends on futures-channel (#1229)
1 parent 1f9e765 commit 08119c4

File tree

5 files changed

+6
-28
lines changed

5 files changed

+6
-28
lines changed

opentelemetry-stackdriver/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ impl StackDriverExporter {
9696
impl SpanExporter for StackDriverExporter {
9797
fn export(&mut self, batch: Vec<SpanData>) -> BoxFuture<'static, ExportResult> {
9898
match self.tx.try_send(batch) {
99-
Err(e) => Box::pin(std::future::ready(Err(e.into()))),
99+
Err(e) => Box::pin(std::future::ready(Err(TraceError::Other(Box::new(
100+
e.into_send_error(),
101+
))))),
100102
Ok(()) => {
101103
self.pending_count.fetch_add(1, Ordering::Relaxed);
102104
Box::pin(std::future::ready(Ok(())))

opentelemetry/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ This release should been seen as 1.0-rc3 following 1.0-rc2 in v0.19.0. Refer to
2727
- Drop include_trace_context parameter from Logs API/SDK. [#1133](https://github.com/open-telemetry/opentelemetry-rust/issues/1133)
2828
- Synchronous instruments no longer accepts `Context` while reporting
2929
measurements. [#1076](https://github.com/open-telemetry/opentelemetry-rust/pull/1076).
30+
- Fallible conversions from `futures-channel` error types to `LogError` and
31+
`TraceError` removed.
32+
[#1201](https://github.com/open-telemetry/opentelemetry-rust/issues/1201)
3033

3134
### Fixed
3235

opentelemetry/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ all-features = true
2121
rustdoc-args = ["--cfg", "docsrs"]
2222

2323
[dependencies]
24-
futures-channel = "0.3"
2524
futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] }
2625
indexmap = "2.0"
2726
once_cell = "1.12.0"

opentelemetry/src/logs/mod.rs

-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! # OpenTelemetry Logs API
22
33
use crate::ExportError;
4-
use futures_channel::{mpsc::TrySendError, oneshot::Canceled};
54
use std::time::Duration;
65
use thiserror::Error;
76

@@ -42,18 +41,6 @@ where
4241
}
4342
}
4443

45-
impl<T> From<TrySendError<T>> for LogError {
46-
fn from(err: TrySendError<T>) -> Self {
47-
LogError::Other(Box::new(err.into_send_error()))
48-
}
49-
}
50-
51-
impl From<Canceled> for LogError {
52-
fn from(err: Canceled) -> Self {
53-
LogError::Other(Box::new(err))
54-
}
55-
}
56-
5744
impl From<String> for LogError {
5845
fn from(err_msg: String) -> Self {
5946
LogError::Other(Box::new(Custom(err_msg)))

opentelemetry/src/trace/mod.rs

-13
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@
162162
//! some_work().with_context(Context::current_with_span(span));
163163
//! ```
164164
165-
use futures_channel::{mpsc::TrySendError, oneshot::Canceled};
166165
use std::borrow::Cow;
167166
use std::time;
168167
use thiserror::Error;
@@ -218,18 +217,6 @@ where
218217
}
219218
}
220219

221-
impl<T> From<TrySendError<T>> for TraceError {
222-
fn from(err: TrySendError<T>) -> Self {
223-
TraceError::Other(Box::new(err.into_send_error()))
224-
}
225-
}
226-
227-
impl From<Canceled> for TraceError {
228-
fn from(err: Canceled) -> Self {
229-
TraceError::Other(Box::new(err))
230-
}
231-
}
232-
233220
impl From<String> for TraceError {
234221
fn from(err_msg: String) -> Self {
235222
TraceError::Other(Box::new(Custom(err_msg)))

0 commit comments

Comments
 (0)