Skip to content
3 changes: 2 additions & 1 deletion opentelemetry-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rt-tokio-current-thread = ["tokio", "tokio-stream", "experimental_async_runtime"
internal-logs = ["opentelemetry/internal-logs"]
experimental_metrics_periodicreader_with_async_runtime = ["metrics", "experimental_async_runtime"]
spec_unstable_metrics_views = ["metrics"]
experimental_custom_metric_reader = ["metrics"]
experimental_logs_batch_log_processor_with_async_runtime = ["logs", "experimental_async_runtime"]
experimental_logs_concurrent_log_processor = ["logs"]
experimental_trace_batch_span_processor_with_async_runtime = ["trace", "experimental_async_runtime"]
Expand Down Expand Up @@ -107,7 +108,7 @@ required-features = ["testing"]
[[bench]]
name = "metric"
harness = false
required-features = ["metrics", "spec_unstable_metrics_views"]
required-features = ["metrics", "spec_unstable_metrics_views", "experimental_custom_metric_reader"]

[[bench]]
name = "log"
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/metrics/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ where
mod tests {
use std::borrow::Cow;

use crate::metrics::MetricError;
use crate::metrics::error::MetricError;

use super::{
validate_instrument_name, validate_instrument_unit, INSTRUMENT_NAME_EMPTY,
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-sdk/src/metrics/meter_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use crate::error::OTelSdkResult;
use crate::Resource;

use super::{
exporter::PushMetricExporter, meter::SdkMeter, noop::NoopMeter, pipeline::Pipelines,
reader::MetricReader, view::View, PeriodicReader,
exporter::PushMetricExporter, meter::SdkMeter, noop::NoopMeter,
periodic_reader::PeriodicReader, pipeline::Pipelines, reader::MetricReader, view::View,
};

/// Handles the creation and coordination of [Meter]s.
Expand Down
8 changes: 8 additions & 0 deletions opentelemetry-sdk/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,21 @@ mod error;
pub mod exporter;
pub(crate) mod instrument;
pub(crate) mod internal;
#[cfg(feature = "experimental_custom_metric_reader")]
pub(crate) mod manual_reader;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just delete manual_reader.rs file instead of providing it under a feature. There doesn't seem to be any use case for it.

pub(crate) mod meter;
mod meter_provider;
pub(crate) mod noop;
#[allow(unreachable_pub)]
pub(crate) mod periodic_reader;
#[cfg(feature = "experimental_metrics_periodicreader_with_async_runtime")]
/// Module for periodic reader with async runtime.
pub mod periodic_reader_with_async_runtime;
pub(crate) mod pipeline;
#[cfg(feature = "experimental_custom_metric_reader")]
pub mod reader;
#[cfg(not(feature = "experimental_custom_metric_reader"))]
pub(crate) mod reader;
pub(crate) mod view;

/// In-Memory metric exporter for testing purpose.
Expand All @@ -68,9 +73,12 @@ pub use in_memory_exporter::{InMemoryMetricExporter, InMemoryMetricExporterBuild
pub use aggregation::*;
#[cfg(feature = "spec_unstable_metrics_views")]
pub use error::{MetricError, MetricResult};
#[cfg(feature = "experimental_custom_metric_reader")]
pub use manual_reader::*;
pub use meter_provider::*;
#[cfg(feature = "experimental_custom_metric_reader")]
pub use periodic_reader::*;
#[cfg(feature = "experimental_custom_metric_reader")]
pub use pipeline::Pipeline;

pub use instrument::InstrumentKind;
Expand Down
4 changes: 3 additions & 1 deletion opentelemetry-sdk/src/metrics/periodic_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use crate::{
};

use super::{
data::ResourceMetrics, instrument::InstrumentKind, reader::MetricReader, Pipeline, Temporality,
data::ResourceMetrics, instrument::InstrumentKind, pipeline::Pipeline, reader::MetricReader,
Temporality,
};

const DEFAULT_INTERVAL: Duration = Duration::from_secs(60);
Expand Down Expand Up @@ -51,6 +52,7 @@ where
///
/// If this option is not used or `interval` is equal to zero, 60 seconds is
/// used as the default.
#[allow(unused)]
pub fn with_interval(mut self, interval: Duration) -> Self {
if !interval.is_zero() {
self.interval = interval;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
Resource,
};

use super::{data::ResourceMetrics, reader::MetricReader, InstrumentKind, Pipeline};
use super::{data::ResourceMetrics, pipeline::Pipeline, reader::MetricReader, InstrumentKind};

const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30);
const DEFAULT_INTERVAL: Duration = Duration::from_secs(60);
Expand Down
2 changes: 1 addition & 1 deletion stress/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ctrlc = { workspace = true }
lazy_static = { workspace = true }
num_cpus = { workspace = true }
opentelemetry = { path = "../opentelemetry", features = ["metrics", "logs", "trace", "spec_unstable_logs_enabled"] }
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["metrics", "logs", "trace", "spec_unstable_logs_enabled", "experimental_logs_concurrent_log_processor"] }
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["metrics", "logs", "trace", "spec_unstable_logs_enabled", "experimental_logs_concurrent_log_processor", "experimental_custom_metric_reader"] }
opentelemetry-appender-tracing = { workspace = true, features = ["spec_unstable_logs_enabled"] }
rand = { workspace = true, features = ["small_rng", "os_rng"] }
tracing = { workspace = true, features = ["std"]}
Expand Down