Skip to content

Commit 32a68ec

Browse files
committed
hide metricreader
1 parent 8b3fc06 commit 32a68ec

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

opentelemetry-sdk/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rt-tokio-current-thread = ["tokio", "tokio-stream", "experimental_async_runtime"
5353
internal-logs = ["opentelemetry/internal-logs"]
5454
experimental_metrics_periodicreader_with_async_runtime = ["metrics", "experimental_async_runtime"]
5555
spec_unstable_metrics_views = ["metrics"]
56+
experimental_custom_metric_reader = ["metrics"]
5657
experimental_logs_batch_log_processor_with_async_runtime = ["logs", "experimental_async_runtime"]
5758
experimental_logs_concurrent_log_processor = ["logs"]
5859
experimental_trace_batch_span_processor_with_async_runtime = ["trace", "experimental_async_runtime"]

opentelemetry-sdk/src/metrics/meter_provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use crate::error::OTelSdkResult;
1616
use crate::Resource;
1717

1818
use super::{
19-
exporter::PushMetricExporter, meter::SdkMeter, noop::NoopMeter, pipeline::Pipelines,
20-
reader::MetricReader, view::View, PeriodicReader,
19+
exporter::PushMetricExporter, meter::SdkMeter, noop::NoopMeter,
20+
periodic_reader::PeriodicReader, pipeline::Pipelines, reader::MetricReader, view::View,
2121
};
2222

2323
/// Handles the creation and coordination of [Meter]s.

opentelemetry-sdk/src/metrics/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,21 @@ mod error;
4545
pub mod exporter;
4646
pub(crate) mod instrument;
4747
pub(crate) mod internal;
48+
#[cfg(feature = "experimental_custom_metric_reader")]
4849
pub(crate) mod manual_reader;
4950
pub(crate) mod meter;
5051
mod meter_provider;
5152
pub(crate) mod noop;
53+
#[allow(unreachable_pub)]
5254
pub(crate) mod periodic_reader;
5355
#[cfg(feature = "experimental_metrics_periodicreader_with_async_runtime")]
5456
/// Module for periodic reader with async runtime.
5557
pub mod periodic_reader_with_async_runtime;
5658
pub(crate) mod pipeline;
59+
#[cfg(feature = "experimental_custom_metric_reader")]
5760
pub mod reader;
61+
#[cfg(not(feature = "experimental_custom_metric_reader"))]
62+
pub(crate) mod reader;
5863
pub(crate) mod view;
5964

6065
/// In-Memory metric exporter for testing purpose.
@@ -68,9 +73,12 @@ pub use in_memory_exporter::{InMemoryMetricExporter, InMemoryMetricExporterBuild
6873
pub use aggregation::*;
6974
#[cfg(feature = "spec_unstable_metrics_views")]
7075
pub use error::{MetricError, MetricResult};
76+
#[cfg(feature = "experimental_custom_metric_reader")]
7177
pub use manual_reader::*;
7278
pub use meter_provider::*;
79+
#[cfg(feature = "experimental_custom_metric_reader")]
7380
pub use periodic_reader::*;
81+
#[cfg(feature = "experimental_custom_metric_reader")]
7482
pub use pipeline::Pipeline;
7583

7684
pub use instrument::InstrumentKind;

opentelemetry-sdk/src/metrics/periodic_reader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::{
1717
};
1818

1919
use super::{
20-
data::ResourceMetrics, instrument::InstrumentKind, reader::MetricReader, Pipeline, Temporality,
20+
data::ResourceMetrics, instrument::InstrumentKind, reader::MetricReader, pipeline::Pipeline, Temporality,
2121
};
2222

2323
const DEFAULT_INTERVAL: Duration = Duration::from_secs(60);
@@ -51,6 +51,7 @@ where
5151
///
5252
/// If this option is not used or `interval` is equal to zero, 60 seconds is
5353
/// used as the default.
54+
#[allow(unused)]
5455
pub fn with_interval(mut self, interval: Duration) -> Self {
5556
if !interval.is_zero() {
5657
self.interval = interval;

0 commit comments

Comments
 (0)