Skip to content
Open
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
2 changes: 1 addition & 1 deletion opentelemetry-appender-log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ experimental_metadata_attributes = ["dep:opentelemetry-semantic-conventions"]
opentelemetry_sdk = { workspace = true, features = ["testing"] }
opentelemetry-stdout = { workspace = true, features = ["logs"] }
log = { workspace = true, features = ["kv_serde"] }
tokio = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
serde = { workspace = true, features = ["std", "derive"] }

[lints]
Expand Down
4 changes: 4 additions & 0 deletions opentelemetry-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## vNext

- **Breaking** The SDK `testing` feature is now runtime agnostic. [#3407][3407]
- `TokioSpanExporter` and `new_tokio_test_exporter` have been renamed to `TestSpanExporter` and `new_test_exporter`.
- The following transitive dependencies and features have been removed: `tokio/rt`, `tokio/time`, `tokio/macros`, `tokio/rt-multi-thread`, `tokio-stream`, `experimental_async_runtime`
- 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`).
- `Aggregation` enum and `StreamBuilder::with_aggregation()` are now stable and no longer require the `spec_unstable_metrics_views` feature flag.
- Fix `service.name` Resource attribute fallback to follow OpenTelemetry
Expand Down Expand Up @@ -29,6 +32,7 @@
[3312]: https://github.com/open-telemetry/opentelemetry-rust/pull/3312
[3248]: https://github.com/open-telemetry/opentelemetry-rust/pull/3248
[3262]: https://github.com/open-telemetry/opentelemetry-rust/pull/3262
[3407]: https://github.com/open-telemetry/opentelemetry-rust/pull/3407

- "spec_unstable_logs_enabled" feature flag is removed. The capability (and the
backing specification) is now stable and is enabled by default.
Expand Down
3 changes: 2 additions & 1 deletion opentelemetry-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rustdoc-args = ["--cfg", "docsrs"]
criterion = { workspace = true, features = ["html_reports"] }
rstest = { workspace = true }
temp-env = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }

[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
pprof = { workspace = true }
Expand All @@ -47,7 +48,7 @@ trace = ["opentelemetry/trace", "rand", "percent-encoding"]
jaeger_remote_sampler = ["trace", "opentelemetry-http", "http", "serde", "serde_json", "url", "experimental_async_runtime"]
logs = ["opentelemetry/logs"]
metrics = ["opentelemetry/metrics"]
testing = ["opentelemetry/testing", "trace", "metrics", "logs", "rt-tokio", "rt-tokio-current-thread", "tokio/macros", "tokio/rt-multi-thread"]
testing = ["opentelemetry/testing", "trace", "metrics", "logs", "tokio/sync"]
experimental_async_runtime = []
rt-tokio = ["tokio/rt", "tokio/time", "tokio-stream", "experimental_async_runtime"]
rt-tokio-current-thread = ["tokio/rt", "tokio/time", "tokio-stream", "experimental_async_runtime"]
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-sdk/src/testing/trace/span_exporters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ pub fn new_test_export_span_data() -> SpanData {
}

#[derive(Debug)]
pub struct TokioSpanExporter {
pub struct TestSpanExporter {
tx_export: tokio::sync::mpsc::UnboundedSender<SpanData>,
tx_shutdown: tokio::sync::mpsc::UnboundedSender<()>,
}

impl SpanExporter for TokioSpanExporter {
impl SpanExporter for TestSpanExporter {
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult {
batch.into_iter().try_for_each(|span_data| {
self.tx_export
Expand All @@ -57,14 +57,14 @@ impl SpanExporter for TokioSpanExporter {
}
}

pub fn new_tokio_test_exporter() -> (
TokioSpanExporter,
pub fn new_test_exporter() -> (
TestSpanExporter,
tokio::sync::mpsc::UnboundedReceiver<SpanData>,
tokio::sync::mpsc::UnboundedReceiver<()>,
) {
let (tx_export, rx_export) = tokio::sync::mpsc::unbounded_channel();
let (tx_shutdown, rx_shutdown) = tokio::sync::mpsc::unbounded_channel();
let exporter = TokioSpanExporter {
let exporter = TestSpanExporter {
tx_export,
tx_shutdown,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ mod tests {
use super::{BatchSpanProcessor, SpanProcessor};
use crate::error::OTelSdkResult;
use crate::runtime;
use crate::testing::trace::{new_test_export_span_data, new_tokio_test_exporter};
use crate::testing::trace::{new_test_export_span_data, new_test_exporter};
use crate::trace::span_processor::{
OTEL_BSP_EXPORT_TIMEOUT, OTEL_BSP_MAX_EXPORT_BATCH_SIZE, OTEL_BSP_MAX_QUEUE_SIZE,
OTEL_BSP_MAX_QUEUE_SIZE_DEFAULT, OTEL_BSP_SCHEDULE_DELAY, OTEL_BSP_SCHEDULE_DELAY_DEFAULT,
Expand Down Expand Up @@ -563,7 +563,7 @@ mod tests {

#[tokio::test]
async fn test_batch_span_processor() {
let (exporter, mut export_receiver, _shutdown_receiver) = new_tokio_test_exporter();
let (exporter, mut export_receiver, _shutdown_receiver) = new_test_exporter();
let config = BatchConfigBuilder::default()
.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
.build();
Expand Down