-
Notifications
You must be signed in to change notification settings - Fork 862
[sdk] Added support for setting CardinalityLimit allowed for the metric managed by the view.
#5312
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
[sdk] Added support for setting CardinalityLimit allowed for the metric managed by the view.
#5312
Conversation
| { | ||
| if (value != null) | ||
| { | ||
| Guard.ThrowIfOutOfRange(value.Value, min: 3, max: int.MaxValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yun-Ting would you put a comment here explaining why min is 3? (consider updating the XML doc to call out the accepted range)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, one for the overflowAttribute when emitOverflowAttribute is set to true, and the other for 0 tag, assuming when users set this value, they want to pass in tags.
Currently, the lower limit for .SetMaxMetricPointsPerMetricStream() is 1, though.
In AggregatorStore, we reserved one for the overflowAttribute.
And in doc, it says one should be reserved for 0 tag (no key/value pair associated).
Also, there had been discussions on whether we should reserve 1 for zero dimension: #2635 (comment).
Maybe this topic indeed worth another PR.
CardinalityLimit allowed for the metric managed by the view.
…/opentelemetry-dotnet into yunl/metricPointPerView
reyang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The current test cases are using reflection, I think eventually we should remove reflection and test against the real limits (e.g. set a limit and see if we hit it or not). Not blocking this PR since it requires many changes in other places (including fixing some bugs).
CardinalityLimit allowed for the metric managed by the view.CardinalityLimit allowed for the metric managed by the view.
Changes
Fixes #5296
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes