Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: reduce dependencies on futures #59

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ fastrace-jaeger = { path = "fastrace-jaeger" }
fastrace-opentelemetry = { path = "fastrace-opentelemetry" }

# crates.io dependencies
futures = { version = "0.3" }
log = { version = "0.4" }
serde = { version = "1.0", features = ["derive"] }

Expand Down
1 change: 0 additions & 1 deletion fastrace-datadog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ rmp-serde = "1.3"
serde = { workspace = true }

[dev-dependencies]
futures = { workspace = true }
6 changes: 4 additions & 2 deletions fastrace-futures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ rust-version.workspace = true

[dependencies]
fastrace = { workspace = true }
futures = { workspace = true }
futures-core = { version = "0.3.31" }
futures-sink = { version = "0.3.31" }
pin-project = { version = "1.1.8" }

[dev-dependencies]
async-stream = "0.3"
async-stream = { version = "0.3" }
futures = { version = "0.3" }
tokio = { version = "1.38", features = ["rt", "time", "macros"] }
4 changes: 2 additions & 2 deletions fastrace-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::task::Context;
use std::task::Poll;

use fastrace::Span;
use futures::Sink;
use futures::Stream;
use futures_core::Stream;
use futures_sink::Sink;

/// An extension trait for [`Stream`] that provides tracing instrument adapters.
pub trait StreamExt: Stream + Sized {
Expand Down
1 change: 0 additions & 1 deletion fastrace-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ log = { workspace = true }
thrift_codec = "0.3"

[dev-dependencies]
futures = { workspace = true }
2 changes: 1 addition & 1 deletion fastrace-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ rust-version.workspace = true

[dependencies]
fastrace = { workspace = true }
futures = { workspace = true, features = ["executor"] }
log = { workspace = true }
opentelemetry = { version = "0.27", features = ["trace"] }
opentelemetry_sdk = { version = "0.27", features = ["trace"] }
pollster = { version = "0.4.0" }

[dev-dependencies]
opentelemetry-otlp = { version = "0.27", features = ["trace"] }
Expand Down
2 changes: 1 addition & 1 deletion fastrace-opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl OpenTelemetryReporter {

fn try_report(&mut self, spans: Vec<SpanRecord>) -> Result<(), Box<dyn std::error::Error>> {
let spans = self.convert(spans);
futures::executor::block_on(self.exporter.export(spans))?;
pollster::block_on(self.exporter.export(spans))?;
Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion fastrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ fastrace-datadog = { workspace = true }
fastrace-jaeger = { workspace = true }
fastrace-opentelemetry = { workspace = true }
flume = "0.11"
futures = { workspace = true }
futures-timer = "3"
log = { workspace = true }
logcall = "0.1"
Expand All @@ -45,6 +44,7 @@ mockall = "0.13"
opentelemetry = { version = "0.27", features = ["trace"] }
opentelemetry-otlp = { version = "0.27", features = ["trace"] }
opentelemetry_sdk = { version = "0.27", features = ["trace"] }
pollster = { version = "0.4.0" }
rand = "0.9"
rustracing = "0.6"
serial_test = "3.1"
Expand Down
2 changes: 1 addition & 1 deletion fastrace/benches/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn bench_trace_future(c: &mut Criterion) {
group.bench_function(len.to_string(), |b| {
b.iter(|| {
let root = Span::root("root", SpanContext::new(TraceId(12), SpanId::default()));
futures::executor::block_on(f(*len).in_span(root));
pollster::block_on(f(*len).in_span(root));
})
});
}
Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
//! use fastrace::collector::Config;
//! use fastrace::collector::ConsoleReporter;
//! use fastrace::prelude::*;
//! use futures::executor::block_on;
//! use pollster::block_on;
//!
//! #[trace]
//! fn do_something(i: u64) {
Expand Down
2 changes: 1 addition & 1 deletion fastrace/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use fastrace::collector::TestReporter;
use fastrace::local::LocalCollector;
use fastrace::prelude::*;
use fastrace::util::tree::tree_str_from_span_records;
use futures::executor::block_on;
use pollster::block_on;
use serial_test::serial;
use tokio::runtime::Builder;

Expand Down
Loading