-
Notifications
You must be signed in to change notification settings - Fork 500
Implementing configurable aggregation cardinality limit #3624
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
ThomsonTan
merged 39 commits into
open-telemetry:main
from
ThomsonTan:add_cadinality_limit
Sep 11, 2025
+222
−16
Merged
Changes from 25 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
f3c38a3
Implementing configurable aggregation cardinality limit and collector…
PradSenn 0d80b39
Fixing initialization order issue
PradSenn 491ef3c
Merge branch 'main' into main
PradSenn 671e4ca
Fixing integer size mismatch error
PradSenn 203fd46
Merge branch 'main' into main
lalitb 3af667c
Merge branch 'main' into main
ThomsonTan 277f5ee
Merge branch 'main' into PradSenn/main
ThomsonTan db29ab1
Resolve conflict in meter.cc
ThomsonTan 14aa407
Fix View constructor
ThomsonTan 5f153a2
Fix format
ThomsonTan b446e6f
Fix iwyu
ThomsonTan 9b34954
Fix more iwyu
ThomsonTan 5186013
More fix on iywu
ThomsonTan 969ad85
More iwyu
ThomsonTan 8a5b7a1
More fix on iwyu
ThomsonTan 34f1d13
Merge branch 'main' into add_cadinality_limit
ThomsonTan 6c91fbb
More iwyu fix
ThomsonTan 2c9305c
Remove extra empty line
ThomsonTan 100959c
More iwyu fix
ThomsonTan f6719f2
One more iwyu
ThomsonTan d0c4b95
Increase test timeout for valgrind
ThomsonTan d4aaf6a
Update changelog
ThomsonTan c7b4a64
Merge branch 'main' into add_cadinality_limit
ThomsonTan f3ea8f0
Address feedback
ThomsonTan d8d4fdd
Format code
ThomsonTan fcebda2
Merge branch 'main' into add_cadinality_limit
ThomsonTan 121d6c6
Address feedback
ThomsonTan 9c6fb5e
Address more feedback
ThomsonTan f81f8bd
Remove static inline which is C++ 17
ThomsonTan 93b9914
Reformat
ThomsonTan 274614c
Merge branch 'main' into add_cadinality_limit
ThomsonTan 7dde674
Move GetOrDefault to AggregationConfig
ThomsonTan dc5661c
Address feedback
ThomsonTan df2c451
Run format
ThomsonTan 49eac75
Revert "Run format"
ThomsonTan 02fc44e
Revert "Address feedback"
ThomsonTan e29dc0f
Merge branch 'main' into add_cadinality_limit
lalitb a42ae43
Address feedback
ThomsonTan 24ed437
Merge branch 'main' into add_cadinality_limit
marcalff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,11 +25,13 @@ | |
#include "opentelemetry/sdk/metrics/state/attributes_hashmap.h" | ||
#include "opentelemetry/sdk/metrics/state/filtered_ordered_attribute_map.h" | ||
#include "opentelemetry/sdk/metrics/state/metric_collector.h" | ||
#include "opentelemetry/sdk/metrics/view/attributes_processor.h" | ||
|
||
#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW | ||
# include "opentelemetry/sdk/metrics/data/exemplar_data.h" | ||
# include "opentelemetry/sdk/metrics/exemplar/filter_type.h" | ||
# include "opentelemetry/sdk/metrics/exemplar/reservoir.h" | ||
#else | ||
# include "opentelemetry/sdk/metrics/view/attributes_processor.h" | ||
#endif | ||
|
||
ThomsonTan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
using namespace opentelemetry::sdk::metrics; | ||
|
@@ -192,8 +194,10 @@ TEST_P(WritableMetricStorageTestUpDownFixture, TestAggregation) | |
} | ||
return true; | ||
}); | ||
// subsequent recording after collection shouldn't fail | ||
// monotonic increasing values; | ||
// Note: When the cardinality limit is set to n, the attributes hashmap emits n-1 distinct | ||
// attribute sets, plus an overflow bucket for additional attributes. The test logic below is made | ||
// generic to succeed for either n or n-1 total cardinality. If this behavior is unexpected, | ||
// please investigate and file an issue. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the spec, the overflow bucket is included in the cardinality limit, not added on top of it. We can remove this comment, or update accordingly. |
||
int64_t get_count2 = -50; | ||
int64_t put_count2 = -70; | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.