Skip to content

Commit 71e947e

Browse files
committed
chore(sdk): rename TokioSpanExporter to TestSpanExporter
1 parent bb32774 commit 71e947e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## vNext
44

5+
- **Breaking** The SDK `testing` feature is now runtime agnostic. [#3407][3407]
6+
- `TokioSpanExporter` and `new_tokio_test_exporter` have been renamed to `TestSpanExporter` and `new_test_exporter`.
7+
- The following transitive dependencies and features have been removed: `tokio/rt`, `tokio/time`, `tokio/macros`, `tokio/rt-multi-thread`, `tokio-stream`, `experimental_async_runtime`
58
- Add 32-bit platform support by using `portable-atomic` for `AtomicI64` and `AtomicU64` in the metrics module. This enables compilation on 32-bit ARM targets (e.g., `armv5te-unknown-linux-gnueabi`, `armv7-unknown-linux-gnueabihf`).
69
- `Aggregation` enum and `StreamBuilder::with_aggregation()` are now stable and no longer require the `spec_unstable_metrics_views` feature flag.
710
- Fix `service.name` Resource attribute fallback to follow OpenTelemetry
@@ -29,6 +32,7 @@
2932
[3312]: https://github.com/open-telemetry/opentelemetry-rust/pull/3312
3033
[3248]: https://github.com/open-telemetry/opentelemetry-rust/pull/3248
3134
[3262]: https://github.com/open-telemetry/opentelemetry-rust/pull/3262
35+
[3407]: https://github.com/open-telemetry/opentelemetry-rust/pull/3407
3236

3337
- "spec_unstable_logs_enabled" feature flag is removed. The capability (and the
3438
backing specification) is now stable and is enabled by default.

opentelemetry-sdk/src/testing/trace/span_exporters.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ pub fn new_test_export_span_data() -> SpanData {
3636
}
3737

3838
#[derive(Debug)]
39-
pub struct TokioSpanExporter {
39+
pub struct TestSpanExporter {
4040
tx_export: tokio::sync::mpsc::UnboundedSender<SpanData>,
4141
tx_shutdown: tokio::sync::mpsc::UnboundedSender<()>,
4242
}
4343

44-
impl SpanExporter for TokioSpanExporter {
44+
impl SpanExporter for TestSpanExporter {
4545
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult {
4646
batch.into_iter().try_for_each(|span_data| {
4747
self.tx_export
@@ -57,14 +57,14 @@ impl SpanExporter for TokioSpanExporter {
5757
}
5858
}
5959

60-
pub fn new_tokio_test_exporter() -> (
61-
TokioSpanExporter,
60+
pub fn new_test_exporter() -> (
61+
TestSpanExporter,
6262
tokio::sync::mpsc::UnboundedReceiver<SpanData>,
6363
tokio::sync::mpsc::UnboundedReceiver<()>,
6464
) {
6565
let (tx_export, rx_export) = tokio::sync::mpsc::unbounded_channel();
6666
let (tx_shutdown, rx_shutdown) = tokio::sync::mpsc::unbounded_channel();
67-
let exporter = TokioSpanExporter {
67+
let exporter = TestSpanExporter {
6868
tx_export,
6969
tx_shutdown,
7070
};

opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ mod tests {
449449
use super::{BatchSpanProcessor, SpanProcessor};
450450
use crate::error::OTelSdkResult;
451451
use crate::runtime;
452-
use crate::testing::trace::{new_test_export_span_data, new_tokio_test_exporter};
452+
use crate::testing::trace::{new_test_export_span_data, new_test_exporter};
453453
use crate::trace::span_processor::{
454454
OTEL_BSP_EXPORT_TIMEOUT, OTEL_BSP_MAX_EXPORT_BATCH_SIZE, OTEL_BSP_MAX_QUEUE_SIZE,
455455
OTEL_BSP_MAX_QUEUE_SIZE_DEFAULT, OTEL_BSP_SCHEDULE_DELAY, OTEL_BSP_SCHEDULE_DELAY_DEFAULT,
@@ -563,7 +563,7 @@ mod tests {
563563

564564
#[tokio::test]
565565
async fn test_batch_span_processor() {
566-
let (exporter, mut export_receiver, _shutdown_receiver) = new_tokio_test_exporter();
566+
let (exporter, mut export_receiver, _shutdown_receiver) = new_test_exporter();
567567
let config = BatchConfigBuilder::default()
568568
.with_scheduled_delay(Duration::from_secs(60 * 60 * 24)) // set the tick to 24 hours so we know the span must be exported via force_flush
569569
.build();

0 commit comments

Comments
 (0)