Skip to content

Commit

Permalink
opentelemetry crate no longer depends on futures-channel (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaun-cox authored Aug 28, 2023
1 parent 1f9e765 commit 08119c4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 28 deletions.
4 changes: 3 additions & 1 deletion opentelemetry-stackdriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ impl StackDriverExporter {
impl SpanExporter for StackDriverExporter {
fn export(&mut self, batch: Vec<SpanData>) -> 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(())))
Expand Down
3 changes: 3 additions & 0 deletions opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 0 additions & 13 deletions opentelemetry/src/logs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! # OpenTelemetry Logs API

use crate::ExportError;
use futures_channel::{mpsc::TrySendError, oneshot::Canceled};
use std::time::Duration;
use thiserror::Error;

Expand Down Expand Up @@ -42,18 +41,6 @@ where
}
}

impl<T> From<TrySendError<T>> for LogError {
fn from(err: TrySendError<T>) -> Self {
LogError::Other(Box::new(err.into_send_error()))
}
}

impl From<Canceled> for LogError {
fn from(err: Canceled) -> Self {
LogError::Other(Box::new(err))
}
}

impl From<String> for LogError {
fn from(err_msg: String) -> Self {
LogError::Other(Box::new(Custom(err_msg)))
Expand Down
13 changes: 0 additions & 13 deletions opentelemetry/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -218,18 +217,6 @@ where
}
}

impl<T> From<TrySendError<T>> for TraceError {
fn from(err: TrySendError<T>) -> Self {
TraceError::Other(Box::new(err.into_send_error()))
}
}

impl From<Canceled> for TraceError {
fn from(err: Canceled) -> Self {
TraceError::Other(Box::new(err))
}
}

impl From<String> for TraceError {
fn from(err_msg: String) -> Self {
TraceError::Other(Box::new(Custom(err_msg)))
Expand Down

0 comments on commit 08119c4

Please sign in to comment.