Skip to content

Commit 7d0afad

Browse files
authored
Merge branch 'main' into cijothomas/tracingd
2 parents fca28e6 + 01898be commit 7d0afad

File tree

13 files changed

+18
-115
lines changed

13 files changed

+18
-115
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ It's important to regularly review and remove the `otel_unstable` flag from the
172172

173173
The potential features include:
174174

175-
- Stable and non-experimental features that compliant to specification, and have a feature flag to minimize compilation size. Example: feature flags for signals (like `logs`, `traces`, `metrics`) and runtimes (`rt-tokio`, `rt-tokio-current-thread`, `rt-async-std`).
175+
- Stable and non-experimental features that are compliant with the specification and have a feature flag to minimize compilation size. Example: feature flags for signals (like `logs`, `traces`, `metrics`) and runtimes (`rt-tokio`, `rt-tokio-current-thread`).
176176
- Stable and non-experimental features, although not part of the specification, are crucial for enhancing the tracing/log crate's functionality or boosting performance. These features are also subject to discussion and approval by the OpenTelemetry Rust Maintainers.
177177

178178
All such features should adhere to naming convention `<signal>_<feature_name>`

opentelemetry-otlp/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
//! ```
142142
//!
143143
//! [`tokio`]: https://tokio.rs
144-
//! [`async-std`]: https://async.rs
145144
//!
146145
//! # Feature Flags
147146
//! The following feature flags can enable exporters for different telemetry signals:

opentelemetry-sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- **Breaking**: The `Runtime` trait has been simplified and refined. See the [#2641](https://github.com/open-telemetry/opentelemetry-rust/pull/2641)
66
for the changes.
7+
- Removed `async-std` support for `Runtime`, as [`async-std` crate is deprecated](https://crates.io/crates/async-std).
78
- Calls to `MeterProviderBuilder::with_resource`, `TracerProviderBuilder::with_resource`,
89
`LoggerProviderBuilder::with_resource` are now additive ([#2677](https://github.com/open-telemetry/opentelemetry-rust/pull/2677)).
910
- Moved `ExportError` trait from `opentelemetry::trace::ExportError` to `opentelemetry_sdk::export::ExportError`

opentelemetry-sdk/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ rust-version = "1.75.0"
1212
[dependencies]
1313
opentelemetry = { version = "0.28", path = "../opentelemetry/" }
1414
opentelemetry-http = { version = "0.28", path = "../opentelemetry-http", optional = true }
15-
async-std = { workspace = true, features = ["unstable"], optional = true }
1615
futures-channel = { workspace = true }
1716
futures-executor = { workspace = true }
1817
futures-util = { workspace = true, features = ["std", "sink", "async-await-macro"] }
@@ -47,11 +46,10 @@ jaeger_remote_sampler = ["trace", "opentelemetry-http", "http", "serde", "serde_
4746
logs = ["opentelemetry/logs", "serde_json"]
4847
spec_unstable_logs_enabled = ["logs", "opentelemetry/spec_unstable_logs_enabled"]
4948
metrics = ["opentelemetry/metrics", "glob"]
50-
testing = ["opentelemetry/testing", "trace", "metrics", "logs", "rt-async-std", "rt-tokio", "rt-tokio-current-thread", "tokio/macros", "tokio/rt-multi-thread"]
49+
testing = ["opentelemetry/testing", "trace", "metrics", "logs", "rt-tokio", "rt-tokio-current-thread", "tokio/macros", "tokio/rt-multi-thread"]
5150
experimental_async_runtime = []
5251
rt-tokio = ["tokio", "tokio-stream", "experimental_async_runtime"]
5352
rt-tokio-current-thread = ["tokio", "tokio-stream", "experimental_async_runtime"]
54-
rt-async-std = ["async-std", "experimental_async_runtime"]
5553
internal-logs = ["tracing"]
5654
experimental_metrics_periodicreader_with_async_runtime = ["metrics"]
5755
spec_unstable_metrics_views = ["metrics"]

opentelemetry-sdk/benches/log_enabled.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
Total Number of Cores:   14 (10 performance and 4 efficiency)
66
| Test | Average time|
77
|---------------------------------------------|-------------|
8-
| exporter_disabled_concurrent_processor | 1.9 ns |
9-
| exporter_disabled_simple_processor | 5.0 ns |
8+
| exporter_disabled_concurrent_processor | 980 ps |
9+
| exporter_disabled_simple_processor | 4.3 ns |
1010
*/
1111

12+
// cargo bench --bench log_enabled --features="spec_unstable_logs_enabled,experimental_logs_concurrent_log_processor"
13+
1214
use criterion::{criterion_group, criterion_main, Criterion};
1315
use opentelemetry::logs::{Logger, LoggerProvider};
1416
use opentelemetry_sdk::error::OTelSdkResult;
@@ -31,6 +33,7 @@ impl LogExporter for NoopExporter {
3133
Ok(())
3234
}
3335

36+
#[inline]
3437
fn event_enabled(
3538
&self,
3639
_level: opentelemetry::logs::Severity,

opentelemetry-sdk/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@
9494
//! * `experimental_async_runtime`: Enables the experimental `Runtime` trait and related functionality.
9595
//! * `rt-tokio`: Spawn telemetry tasks using [tokio]'s multi-thread runtime.
9696
//! * `rt-tokio-current-thread`: Spawn telemetry tasks on a separate runtime so that the main runtime won't be blocked.
97-
//! * `rt-async-std`: Spawn telemetry tasks using [async-std]'s runtime.
9897
//!
9998
//! [tokio]: https://crates.io/crates/tokio
100-
//! [async-std]: https://crates.io/crates/async-std
10199
#![warn(
102100
future_incompatible,
103101
missing_debug_implementations,

opentelemetry-sdk/src/logs/concurrent_log_processor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl<T: LogExporter> LogProcessor for SimpleConcurrentLogProcessor<T> {
4848
}
4949

5050
#[cfg(feature = "spec_unstable_logs_enabled")]
51+
#[inline]
5152
fn event_enabled(
5253
&self,
5354
level: opentelemetry::logs::Severity,

opentelemetry-sdk/src/logs/logger.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ impl opentelemetry::logs::Logger for SdkLogger {
5050
}
5151

5252
#[cfg(feature = "spec_unstable_logs_enabled")]
53+
#[inline]
5354
fn event_enabled(&self, level: Severity, target: &str, name: Option<&str>) -> bool {
5455
self.provider
5556
.log_processors()

opentelemetry-sdk/src/logs/simple_log_processor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ impl<T: LogExporter> LogProcessor for SimpleLogProcessor<T> {
134134
}
135135

136136
#[cfg(feature = "spec_unstable_logs_enabled")]
137+
#[inline]
137138
fn event_enabled(
138139
&self,
139140
level: opentelemetry::logs::Severity,

opentelemetry-sdk/src/runtime.rs

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
//! Provides an abstraction of several async runtimes
22
//!
3-
//! This allows OpenTelemetry to work with any current or future runtime. There are currently
4-
//! builtin implementations for [Tokio] and [async-std].
3+
//! This allows OpenTelemetry to work with any current or future runtime. There is currently
4+
//! built-in implementation for [Tokio].
55
//!
66
//! [Tokio]: https://crates.io/crates/tokio
7-
//! [async-std]: https://crates.io/crates/async-std
87
98
use futures_util::stream::{unfold, Stream};
109
use std::{fmt::Debug, future::Future, time::Duration};
1110
use thiserror::Error;
1211

13-
/// A runtime is an abstraction of an async runtime like [Tokio] or [async-std]. It allows
12+
/// A runtime is an abstraction of an async runtime like [Tokio]. It allows
1413
/// OpenTelemetry to work with any current and hopefully future runtime implementations.
1514
///
1615
/// [Tokio]: https://crates.io/crates/tokio
17-
/// [async-std]: https://crates.io/crates/async-std
1816
///
1917
/// # Note
2018
///
@@ -139,34 +137,6 @@ impl Runtime for TokioCurrentThread {
139137
}
140138
}
141139

142-
/// Runtime implementation, which works with async-std.
143-
#[cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std"))]
144-
#[cfg_attr(
145-
docsrs,
146-
doc(cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std")))
147-
)]
148-
#[derive(Debug, Clone)]
149-
pub struct AsyncStd;
150-
151-
#[cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std"))]
152-
#[cfg_attr(
153-
docsrs,
154-
doc(cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std")))
155-
)]
156-
impl Runtime for AsyncStd {
157-
fn spawn<F>(&self, future: F)
158-
where
159-
F: Future<Output = ()> + Send + 'static,
160-
{
161-
#[allow(clippy::let_underscore_future)]
162-
let _ = async_std::task::spawn(future);
163-
}
164-
165-
fn delay(&self, duration: Duration) -> impl Future<Output = ()> + Send + 'static {
166-
async_std::task::sleep(duration)
167-
}
168-
}
169-
170140
/// `RuntimeChannel` is an extension to [`Runtime`]. Currently, it provides a
171141
/// channel that is used by the [log] and [span] batch processors.
172142
///
@@ -275,32 +245,3 @@ impl RuntimeChannel for TokioCurrentThread {
275245
)
276246
}
277247
}
278-
279-
#[cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std"))]
280-
impl<T: Send> TrySend for async_std::channel::Sender<T> {
281-
type Message = T;
282-
283-
fn try_send(&self, item: Self::Message) -> Result<(), TrySendError> {
284-
self.try_send(item).map_err(|err| match err {
285-
async_std::channel::TrySendError::Full(_) => TrySendError::ChannelFull,
286-
async_std::channel::TrySendError::Closed(_) => TrySendError::ChannelClosed,
287-
})
288-
}
289-
}
290-
291-
#[cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std"))]
292-
#[cfg_attr(
293-
docsrs,
294-
doc(cfg(all(feature = "experimental_async_runtime", feature = "rt-async-std")))
295-
)]
296-
impl RuntimeChannel for AsyncStd {
297-
type Receiver<T: Debug + Send> = async_std::channel::Receiver<T>;
298-
type Sender<T: Debug + Send> = async_std::channel::Sender<T>;
299-
300-
fn batch_message_channel<T: Debug + Send>(
301-
&self,
302-
capacity: usize,
303-
) -> (Self::Sender<T>, Self::Receiver<T>) {
304-
async_std::channel::bounded(capacity)
305-
}
306-
}

0 commit comments

Comments
 (0)