-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Copy AggregationTemporality and IsMonotonic to new metric batches #4389
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4389 +/- ##
==========================================
- Coverage 88.67% 88.67% -0.01%
==========================================
Files 176 176
Lines 10377 10380 +3
==========================================
+ Hits 9202 9204 +2
- Misses 947 948 +1
Partials 228 228
Continue to review full report at Codecov.
|
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.
We should add a changelog note for this
return splitNumberDataPoints(ms.Sum().DataPoints(), dest.Sum().DataPoints(), size) | ||
case pdata.MetricDataTypeHistogram: | ||
dest.Histogram().SetAggregationTemporality(ms.Histogram().AggregationTemporality()) |
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.
It would help to add a testcase for this, to avoid further regressions
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.
+1
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.
@dashpole please do a followup PR.
return splitNumberDataPoints(ms.Sum().DataPoints(), dest.Sum().DataPoints(), size) | ||
case pdata.MetricDataTypeHistogram: | ||
dest.Histogram().SetAggregationTemporality(ms.Histogram().AggregationTemporality()) |
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.
+1
Description:
Fix a regression in which metric batches do not have aggregation temporality and IsMonotonic set for cumulative metrics. The issue was introduced in #3573, where we changed to having to copy each field from the old metric to the new one. These fields were missed, and thus get their default value when new batches of metrics were created.
I looked at the implementation of CopyTo that is used for copying metrics elsewhere to make sure I fix all issues of this type. For Sum, we are missing AggregationTemporality and IsMonotonic. We were also missing AggregationTemporality for histograms, so I added that as well. Both summary and gauges only copy data points, so the status quo is correct.
Link to tracking Issue:
Fixes #4388
Testing:
Unit testing. The test changes I made fail without the corresponding changes to metric splitting. I haven't had a chance to e2e test it yet to show that it fixes the issue I was seeing, but it seems fairly obvious that this is the correct fix for my problems.
cc @Aneurysm9