Skip to content

Commit 0ac6d72

Browse files
committed
cleanup public api
1 parent 51bb6d5 commit 0ac6d72

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ also modified to suppress telemetry before invoking exporters.
4242
behind feature flag "experimental_metrics_custom_reader".
4343
[#2928](https://github.com/open-telemetry/opentelemetry-rust/pull/2928)
4444

45-
- TODO: Placeholder for View related changelog.
45+
- TODO: Placeholder for View related changelog. Polish this after all
46+
changes are done.
47+
Hide public fields from `Stream` struct.
4648

4749
- *Breaking* `Aggregation` enum moved behind feature flag
4850
"spec_unstable_metrics_views". This was only required when using Views.

opentelemetry-sdk/src/metrics/instrument.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,22 +190,22 @@ impl Instrument {
190190
#[allow(unreachable_pub)]
191191
pub struct Stream {
192192
/// The human-readable identifier of the stream.
193-
pub name: Option<Cow<'static, str>>,
193+
pub(crate) name: Option<Cow<'static, str>>,
194194
/// Describes the purpose of the data.
195-
pub description: Option<Cow<'static, str>>,
195+
pub(crate) description: Option<Cow<'static, str>>,
196196
/// the unit of measurement recorded.
197-
pub unit: Option<Cow<'static, str>>,
197+
pub(crate) unit: Option<Cow<'static, str>>,
198198
/// Aggregation the stream uses for an instrument.
199-
pub aggregation: Option<Aggregation>,
199+
pub(crate) aggregation: Option<Aggregation>,
200200
/// An allow-list of attribute keys that will be preserved for the stream.
201201
///
202202
/// Any attribute recorded for the stream with a key not in this set will be
203203
/// dropped. If the set is empty, all attributes will be dropped, if `None` all
204204
/// attributes will be kept.
205-
pub allowed_attribute_keys: Option<Arc<HashSet<Key>>>,
205+
pub(crate) allowed_attribute_keys: Option<Arc<HashSet<Key>>>,
206206

207207
/// Cardinality limit for the stream.
208-
pub cardinality_limit: Option<usize>,
208+
pub(crate) cardinality_limit: Option<usize>,
209209
}
210210

211211
#[cfg(feature = "spec_unstable_metrics_views")]

opentelemetry-sdk/src/metrics/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,6 @@ mod tests {
27022702
unreachable!()
27032703
};
27042704

2705-
27062705
// Expecting (cardinality_limit + 1 overflow + Empty attributes) data points.
27072706
assert_eq!(sum.data_points.len(), cardinality_limit + 1 + 1);
27082707

0 commit comments

Comments
 (0)