Skip to content

Commit 90b0dd4

Browse files
authored
Remove cardinality capping in Metrics (open-telemetry#2528)
1 parent d2a6b3b commit 90b0dd4

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

opentelemetry-sdk/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
257257
- If you're implementing a custom runtime, you must explicitly enable the experimental_async_runtime` feature in your
258258
Cargo.toml and implement the required `Runtime` traits.
259259

260+
- Removed Metrics Cardinality Limit feature. This was originally introduced in
261+
[#1066](https://github.com/open-telemetry/opentelemetry-rust/pull/1066) with a
262+
hardcoded limit of 2000 and no ability to change it. This feature will be
263+
re-introduced in a future date, along with the ability to change the cardinality
264+
limit.
265+
260266
## 0.27.1
261267

262268
Released 2024-Nov-27

opentelemetry-sdk/src/metrics/internal/aggregate.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ use super::{
1818
pub(crate) const STREAM_CARDINALITY_LIMIT: usize = 2000;
1919

2020
/// Checks whether aggregator has hit cardinality limit for metric streams
21-
pub(crate) fn is_under_cardinality_limit(size: usize) -> bool {
22-
size < STREAM_CARDINALITY_LIMIT
21+
pub(crate) fn is_under_cardinality_limit(_size: usize) -> bool {
22+
true
23+
24+
// TODO: Implement this feature, after allowing the ability to customize the cardinality limit.
25+
// size < STREAM_CARDINALITY_LIMIT
2326
}
2427

2528
/// Receives measurements to be aggregated.

opentelemetry-sdk/src/metrics/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,13 @@ mod tests {
259259
assert_eq!(data_point.value, 50, "Unexpected data point value");
260260
}
261261

262+
#[ignore = "https://github.com/open-telemetry/opentelemetry-rust/issues/1065"]
262263
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
263264
async fn counter_aggregation_overflow_delta() {
264265
counter_aggregation_overflow_helper(Temporality::Delta);
265266
}
266267

268+
#[ignore = "https://github.com/open-telemetry/opentelemetry-rust/issues/1065"]
267269
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
268270
async fn counter_aggregation_overflow_cumulative() {
269271
counter_aggregation_overflow_helper(Temporality::Cumulative);

0 commit comments

Comments
 (0)