-
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
fix: address the first point increase without previous measurement value #7054
Merged
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
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.
👍 Looks good to me! Reviewed everything up to 0a5ee65 in 45 seconds
More details
- Looked at
22
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. pkg/query-service/app/metrics/v4/cumulative/timeseries.go:46
- Draft comment:
The updated experimentalIncreaseWithoutNegative expression divides then multiplies by the same time difference. This seems to cancel out mathematically. Confirm that this formulation is necessary and handles edge cases correctly. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =50%
<= threshold50%
The comment points out a potential mathematical redundancy in the code, which could be a real issue. However, it asks the author to confirm the necessity and correctness of the formulation, which violates the rule against asking for confirmation. The comment could be improved by suggesting a specific change or asking for a test to cover edge cases.
2. pkg/query-service/app/metrics/v4/cumulative/timeseries.go:170
- Draft comment:
Passing 'start' for both %d placeholders assumes both toDateTime time boundaries are identical. Verify that using the same value is intentional. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the author to verify if using the same value for both placeholders is intentional. This falls under the rule of not asking the author to confirm their intention. Therefore, this comment should be removed.
3. pkg/query-service/app/metrics/v4/cumulative/timeseries.go:46
- Draft comment:
Consider refactoring the duplicated time-difference expression. The expression '(ts - lagInFrame(ts, 1, toDateTime(fromUnixTimestamp64Milli(%d))) OVER rate_window)' is repeated; aliasing it could improve clarity and reduce maintenance risk. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
4. pkg/query-service/app/metrics/v4/cumulative/timeseries.go:170
- Draft comment:
Verify that using 'start' for both placeholders in fmt.Sprintf(experimentalIncreaseWithoutNegative, start, start) is intended. - Reason this comment was not posted:
Marked as duplicate.
5. pkg/query-service/app/metrics/v4/cumulative/timeseries.go:46
- Draft comment:
Note that the experimental increase expression omits the 86400-second check seen in the standard increaseWithoutNegative. Ensure this behavioral change is intentional. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is asking the PR author to ensure that a behavioral change is intentional. It is not making a specific code suggestion or asking for a test to be written. Therefore, it violates the rule against asking the author to confirm their intention or ensure behavior is intended.
Workflow ID: wflow_W2u3OLs0tQwGX5fF
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
aniketio-ctrl
approved these changes
Feb 7, 2025
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.
Summary
In this change #6432, we introduced an expression for increase that is simplified from the
increaseWithoutNegative
. However, it has a case where the first value in the window doesn't have any previous value to compare to, and the counter is the cumulative value at the time, which is incorrect. This fix changes the expression, which leads to inf because we don't have a previous point. Does this mean there will be one point missing? No, because we offset by two-step intervals heresignoz/pkg/query-service/common/query_range.go
Lines 18 to 33 in c316491
Important
Fixes
experimentalIncreaseWithoutNegative
intimeseries.go
to handle cases without previous measurement values, preventing incorrect infinite results.experimentalIncreaseWithoutNegative
expression intimeseries.go
to handle cases without previous measurement values.EXPERIMENTAL_INCREASE_WITHOUT_NEGATIVE
environment variable is set.This description was created by
for 0a5ee65. It will automatically update as commits are pushed.