Skip to content

Commit 47d5016

Browse files
authored
Add PeriodicReaderWithOwnThread (#2292)
1 parent b833118 commit 47d5016

File tree

4 files changed

+810
-1
lines changed

4 files changed

+810
-1
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@
4747
- Developers creating custom exporters should ensure they import these constructs from the SDK, not the API.
4848
- [2291](https://github.com/open-telemetry/opentelemetry-rust/pull/2291) Rename `logs_level_enabled flag` to `spec_unstable_logs_enabled`. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.
4949

50-
5150
- **BREAKING**: `Temporality` enum moved from `opentelemetry_sdk::metrics::data::Temporality` to `opentelemetry_sdk::metrics::Temporality`.
5251

52+
- Added a new `PeriodicReader` implementation (`PeriodicReaderWithOwnThread`)
53+
that does not rely on an async runtime, and instead creates own Thread. This
54+
is under feature flag "experimental_metrics_periodic_reader_no_runtime". The
55+
functionality maybe moved into existing PeriodReader or even removed in the
56+
future. As of today, this cannot be used as-is with OTLP Metric Exporter or
57+
any exporter that require an async runtime.
58+
5359
## v0.26.0
5460
Released 2024-Sep-30
5561

opentelemetry-sdk/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rt-tokio = ["tokio", "tokio-stream"]
5353
rt-tokio-current-thread = ["tokio", "tokio-stream"]
5454
rt-async-std = ["async-std"]
5555
internal-logs = ["tracing"]
56+
experimental_metrics_periodic_reader_no_runtime = ["metrics"]
5657

5758
[[bench]]
5859
name = "context"

opentelemetry-sdk/src/metrics/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub(crate) mod meter;
5050
mod meter_provider;
5151
pub(crate) mod noop;
5252
pub(crate) mod periodic_reader;
53+
#[cfg(feature = "experimental_metrics_periodic_reader_no_runtime")]
54+
pub(crate) mod periodic_reader_with_own_thread;
5355
pub(crate) mod pipeline;
5456
pub mod reader;
5557
pub(crate) mod view;
@@ -60,6 +62,8 @@ pub use instrument::*;
6062
pub use manual_reader::*;
6163
pub use meter_provider::*;
6264
pub use periodic_reader::*;
65+
#[cfg(feature = "experimental_metrics_periodic_reader_no_runtime")]
66+
pub use periodic_reader_with_own_thread::*;
6367
pub use pipeline::Pipeline;
6468
pub use view::*;
6569

0 commit comments

Comments
 (0)