-
Notifications
You must be signed in to change notification settings - Fork 2.8k
metricstarttimeprocessor: Implementation of the subtractinitial strategy #38594
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
metricstarttimeprocessor: Implementation of the subtractinitial strategy #38594
Conversation
6f1f6f0
to
7c597ac
Compare
5c61b16
to
51576dd
Compare
Note to the reviewers:
The other changes were made so there is deduplication of the test runners (pulled out to a common |
51576dd
to
740b90a
Compare
cc @aabmass for context with the GCM exporter normalization this mimics |
fyi @pintohutch |
Given that the author is codeowner, who should review this change? What type of review would you like? Please indicate this so we can best help. |
@dashpole (the proposer and other codeowner) would be the ideal candidate, but in his stead, the owners of the Will also need someone from open-telemetry/collector-contrib-approvers to then review to sanity check and merge once ready |
Also @bwplotka FYI |
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.
Mostly questions - thanks for doing this!
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster.go
Outdated
Show resolved
Hide resolved
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster_test.go
Show resolved
Hide resolved
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster_test.go
Outdated
Show resolved
Hide resolved
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster.go
Outdated
Show resolved
Hide resolved
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster.go
Outdated
Show resolved
Hide resolved
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster.go
Outdated
Show resolved
Hide resolved
processor/metricstarttimeprocessor/internal/subtractinitial/adjuster_test.go
Show resolved
Hide resolved
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
0b562f5
to
7dd5402
Compare
3004e15
to
736b2d3
Compare
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.
Mostly naming nits, functionality LGTM
This change addresses open-telemetry#38379.
This change pulls out some common testing utils in a shared internal library. Signed-off-by: Ridwan Sharif <[email protected]>
…iately after the reference is cached Signed-off-by: Ridwan Sharif <[email protected]>
736b2d3
to
98f5481
Compare
Naming is hard 🙈 I think the existing strategy is also a valid one. Described in more detail here: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricstarttimeprocessor#strategy-true-reset-point Opting to keep things as is here to keep the PR ready but open to deprecating other strategies or simplifying this moving forward, should only this strategy be useful |
I think this is ready to merge since the other codeowner, dashpole, is on leave meaning it's just Ridwan. Bartek's most recent comments don't seem to be PR blocking based on my reading. A maintainer may remove this label if they think it's not ready to merge for whatever reason. |
I have reviewed the code summarily and it passes my review. Codeowners have reviewed and approved the change. |
- **[receiver/prometheus] Upgrade receiver.prometheus.removeLegacyResourceAttributes feature flag (#39803)** - **Feature/update library versions (#39848)** - **metricstarttimeprocessor: Implementation of the subtractinitial strategy (#38594)** - **[mongodbatlasreceiver] Add baseURL config (#39345)** - **[receiver/splunkenterprise] Unexport InfoEntry and InfoContent (#39830)** - **[pkg/ottl] Add support for HasPrefix and HasSuffix (#39825)** - **[receiver/snowflakereceiver] fix(security): CVE-2025-46327 : Upgraded gosnowflake to v1.13.3 (#39862)** - **[pkg/winperfcounters] Add support to retrieve raw values (#39835)** - **Update All github.com/aws packages (#39867)** - **use a single version** <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Ridwan Sharif <[email protected]> Signed-off-by: Bogdan Drutu <[email protected]> Co-authored-by: Curtis Robert <[email protected]> Co-authored-by: Ramachandran A G <[email protected]> Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Ridwan Sharif <[email protected]> Co-authored-by: Artur Santos <[email protected]> Co-authored-by: Christos Markou <[email protected]> Co-authored-by: Edmo Vamerlatti Costa <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Bogdan Drutu <[email protected]> Co-authored-by: Paulo Janotti <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]>
…egy (open-telemetry#38594) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Addresses open-telemetry#38379. Some of this logic already existed in the [GCM exporter](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/exporter/collector/internal/normalization/standard_normalizer.go). For each resource, and for each timeseries - Skip if the point is not a cumulative sum, histogram, exp histogram, or summary. - Lookup the timeseries in the cache. If it is not present, drop this point from the batch, and store the timestamp and value (including bucket counts, etc) in the cache. - Subtract cumulative values (e.g. sum, bucket counts) of the cached timeseries from the current timeseries, and set the start timestamp to the cached point's timestamp. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#38379. <!--Describe what testing was performed and which tests were added.--> #### Testing Added unit and integration tests. <!--Describe the documentation added.--> #### Documentation Readme already covers this strategy <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Ridwan Sharif <[email protected]>
…egy (open-telemetry#38594) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Addresses open-telemetry#38379. Some of this logic already existed in the [GCM exporter](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/exporter/collector/internal/normalization/standard_normalizer.go). For each resource, and for each timeseries - Skip if the point is not a cumulative sum, histogram, exp histogram, or summary. - Lookup the timeseries in the cache. If it is not present, drop this point from the batch, and store the timestamp and value (including bucket counts, etc) in the cache. - Subtract cumulative values (e.g. sum, bucket counts) of the cached timeseries from the current timeseries, and set the start timestamp to the cached point's timestamp. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#38379. <!--Describe what testing was performed and which tests were added.--> #### Testing Added unit and integration tests. <!--Describe the documentation added.--> #### Documentation Readme already covers this strategy <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Ridwan Sharif <[email protected]>
…egy (open-telemetry#38594) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Addresses open-telemetry#38379. Some of this logic already existed in the [GCM exporter](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/exporter/collector/internal/normalization/standard_normalizer.go). For each resource, and for each timeseries - Skip if the point is not a cumulative sum, histogram, exp histogram, or summary. - Lookup the timeseries in the cache. If it is not present, drop this point from the batch, and store the timestamp and value (including bucket counts, etc) in the cache. - Subtract cumulative values (e.g. sum, bucket counts) of the cached timeseries from the current timeseries, and set the start timestamp to the cached point's timestamp. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#38379. <!--Describe what testing was performed and which tests were added.--> #### Testing Added unit and integration tests. <!--Describe the documentation added.--> #### Documentation Readme already covers this strategy <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Ridwan Sharif <[email protected]>
Description
Addresses #38379.
Some of this logic already existed in the GCM exporter.
For each resource, and for each timeseries
Link to tracking issue
Fixes #38379.
Testing
Added unit and integration tests.
Documentation
Readme already covers this strategy