Skip to content

Remove cardinality capping in Metrics #2528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions opentelemetry-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
- If you're implementing a custom runtime, you must explicitly enable the experimental_async_runtime` feature in your
Cargo.toml and implement the required `Runtime` traits.

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

## 0.27.1

Released 2024-Nov-27
Expand Down
7 changes: 5 additions & 2 deletions opentelemetry-sdk/src/metrics/internal/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ use super::{
pub(crate) const STREAM_CARDINALITY_LIMIT: usize = 2000;

/// Checks whether aggregator has hit cardinality limit for metric streams
pub(crate) fn is_under_cardinality_limit(size: usize) -> bool {
size < STREAM_CARDINALITY_LIMIT
pub(crate) fn is_under_cardinality_limit(_size: usize) -> bool {
true

// TODO: Implement this feature, after allowing the ability to customize the cardinality limit.
// size < STREAM_CARDINALITY_LIMIT
}

/// Receives measurements to be aggregated.
Expand Down
2 changes: 2 additions & 0 deletions opentelemetry-sdk/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ mod tests {
assert_eq!(data_point.value, 50, "Unexpected data point value");
}

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

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