-
Notifications
You must be signed in to change notification settings - Fork 104
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
Normalize histograms, summaries, and exponential histograms #360
Merged
dashpole
merged 6 commits into
GoogleCloudPlatform:main
from
dashpole:normalize_histograms
Apr 26, 2022
Merged
Normalize histograms, summaries, and exponential histograms #360
dashpole
merged 6 commits into
GoogleCloudPlatform:main
from
dashpole:normalize_histograms
Apr 26, 2022
Conversation
This file contains 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
dashpole
force-pushed
the
normalize_histograms
branch
from
April 18, 2022 21:17
cacfe14
to
115fe6b
Compare
dashpole
commented
Apr 18, 2022
@@ -495,7 +631,7 @@ func TestExponentialHistogramPointToTimeSeries(t *testing.T) { | |||
// Add a second point with no value | |||
hist.DataPoints().AppendEmpty().SetFlags(pmetric.MetricDataPointFlags(pmetric.MetricDataPointFlagNoRecordedValue)) | |||
|
|||
tsl := mapper.exponentialHistogramToTimeSeries(mr, labels{}, metric, hist, point) | |||
tsl := mapper.metricToTimeSeries(mr, labels{}, metric) |
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.
Note to reviewers: this test was broken, in that it wasn't checking the second point with the "NoRecordedValue" flag at all. This change fixes it.
dashpole
commented
Apr 19, 2022
Commenting on the logic from your description, without reading the code:
|
dashpole
commented
Apr 19, 2022
dashpole
force-pushed
the
normalize_histograms
branch
from
April 19, 2022 20:00
0314cfa
to
3a42843
Compare
dashpole
commented
Apr 19, 2022
Merged
jsuereth
reviewed
Apr 22, 2022
dashpole
force-pushed
the
normalize_histograms
branch
from
April 25, 2022 13:46
a23225f
to
3e82766
Compare
dashpole
force-pushed
the
normalize_histograms
branch
from
April 25, 2022 13:48
3e82766
to
27e25f8
Compare
jsuereth
approved these changes
Apr 26, 2022
damemi
added a commit
that referenced
this pull request
Apr 29, 2022
* Do not use IsZero on timestamps obtained from pdata (#336) * do not use IsZero on timestamps obtained from pdata * send summary counts as doubles instead of integers (#338) * drop data points with no value set (#339) * handle NaN sums in histograms and exponential histograms (#340) * Fix broken links, typos in docs (#345) * Update fixtures based on upstream changes to the prometheus receiver (#346) * update fixtures based on upstream changes to the prometheus receiver * feat(propagator): create a new one-way propagator (#343) * feat(propagator): create a new one-way propagator CloudTraceOneWayPropagator moves trace info from X-cloud-trace-context into 'traceparent'. * Apply suggestions from code review Co-authored-by: David Ashpole <[email protected]> * Update propagator to extract both, emit only traceparent Users will no longer need to create a composite propagator, and there's a clear precedence order between trace headers. Co-authored-by: David Ashpole <[email protected]> * Demonstrate that integration tests aren't catching failures (#349) * demonstrate that integration tests aren't catching failures * Update dependencies (#347) update dependencies * address remaining nits from #347 (#351) * prepare for release (#353) * add integration test with metrics from the prometheus receiver (#348) * add make commands for release (#354) * Send timeseries synchronously (#358) * send timeseries syncronously * update docs, and fix existing broken test * Drop histograms without a sum (#359) * update opentelemetry collector to v0.49.0 * drop histograms without a sum * Add sum of squared deviation estimate (#341) * add sum of squared deviation estimate * Add missing otel attributes to Spans exported to Cloud Trace (#365) * Add instrumentation library to span attributes. * Add test to ensure resource + instrumentation-scope labels show up in spans. * Expand testing. * Move resource mapping into shared module, and add monitored resource labels to trace spans. * Do the go mod tidy shuffle. * Fix docker build to include new shared module. * Bump back to go 1.17 * Migrate to SDK version of semantic convention constants instead of Collector's. * Clean up documents. * Normalize histograms, summaries, and exponential histograms (#360) * normalize remaining cumulative data points * use the timeout passed to the metrics exporter (#369) * make gotidy * Resolve conflicts from missed file Co-authored-by: David Ashpole <[email protected]> Co-authored-by: Marc Dougherty <[email protected]> Co-authored-by: Josh Suereth <[email protected]>
damemi
added a commit
that referenced
this pull request
Apr 29, 2022
* Do not use IsZero on timestamps obtained from pdata (#336) * do not use IsZero on timestamps obtained from pdata * send summary counts as doubles instead of integers (#338) * drop data points with no value set (#339) * handle NaN sums in histograms and exponential histograms (#340) * Fix broken links, typos in docs (#345) * Update fixtures based on upstream changes to the prometheus receiver (#346) * update fixtures based on upstream changes to the prometheus receiver * feat(propagator): create a new one-way propagator (#343) * feat(propagator): create a new one-way propagator CloudTraceOneWayPropagator moves trace info from X-cloud-trace-context into 'traceparent'. * Apply suggestions from code review Co-authored-by: David Ashpole <[email protected]> * Update propagator to extract both, emit only traceparent Users will no longer need to create a composite propagator, and there's a clear precedence order between trace headers. Co-authored-by: David Ashpole <[email protected]> * Demonstrate that integration tests aren't catching failures (#349) * demonstrate that integration tests aren't catching failures * Update dependencies (#347) update dependencies * address remaining nits from #347 (#351) * prepare for release (#353) * add integration test with metrics from the prometheus receiver (#348) * add make commands for release (#354) * Send timeseries synchronously (#358) * send timeseries syncronously * update docs, and fix existing broken test * Drop histograms without a sum (#359) * update opentelemetry collector to v0.49.0 * drop histograms without a sum * Add sum of squared deviation estimate (#341) * add sum of squared deviation estimate * Add missing otel attributes to Spans exported to Cloud Trace (#365) * Add instrumentation library to span attributes. * Add test to ensure resource + instrumentation-scope labels show up in spans. * Expand testing. * Move resource mapping into shared module, and add monitored resource labels to trace spans. * Do the go mod tidy shuffle. * Fix docker build to include new shared module. * Bump back to go 1.17 * Migrate to SDK version of semantic convention constants instead of Collector's. * Clean up documents. * Normalize histograms, summaries, and exponential histograms (#360) * normalize remaining cumulative data points * use the timeout passed to the metrics exporter (#369) Co-authored-by: David Ashpole <[email protected]> Co-authored-by: Marc Dougherty <[email protected]> Co-authored-by: Josh Suereth <[email protected]>
This was referenced May 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
Normalization is done for cumulative streams of metrics. For example, if we have a counter that counts the number of seconds since 1970, we wouldn't want to report that number as having happened since we started reading it, since that would produce an enormous rate (>1 billion over 10 seconds). Instead, the first time we see a metric, we record its current value. Then, each time we see the metric again, we "subtract" the original value from the new one. That is trivial for a counter, and we already did that in #323. It is harder for other data types (how do you subtract a histogram from another histogram?).
Changes
This PR extends tracking for the first time we saw a metric by extending the data point cache for other types. It then copies logic for setting the start time for intervals from the sum implementation. Finally, it implements "subtraction" for each of the remaining types: summaries, histograms, and exponential histograms.
For histograms, just subtract the previous sum, previous count, and subtract each bucket from the previous point.
For summaries, leave the quantiles as they are (treat them like gauges passing through), and just subtract previous sum and previous count.
For exponential histograms, subtract the previous sum, previous count. Also subtract each bucket from the previous point, taking the offset into account.