feat(metrics-sdk)!: Metrics cardinality limit#1909
feat(metrics-sdk)!: Metrics cardinality limit#1909xuan-cao-swi wants to merge 22 commits intoopen-telemetry:mainfrom
Conversation
…o metrics-cardinality-limit
|
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
|
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
|
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
Description
This PR introduces cardinality limits for metric attributes, as defined in the metrics SDK specification.
Users can configure the cardinality limit in two ways:
If no limit is provided, the default value of 2000 is used (also negative value will turn to 0 for the limit).
The cardinality limit is enforced during the aggregation update process. When the number of unique attribute combinations exceeds the limit, the extra data points are grouped into a separate data point with the attribute:
This overflow data point is treated like any other data point.
Future work: There is currently duplicated logic across different aggregation implementations. A shared base aggregation class should be introduced to reduce repetition.