feat(metrics-sdk)!: Metrics cardinality limit#1909
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 |
|
👋 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 |
mwear
left a comment
There was a problem hiding this comment.
Mostly LGTM. The current calculations are off by one, however. I added suggestions and some links to the Go and JS implementations. The tests will also need to be updated since they are also off by one.
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
…pentelemetry-ruby into metrics-cardinality-limit
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.