-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: support for window based pagination in new trace v4 #6440
Conversation
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.
❌ Changes requested. Reviewed everything up to 5bf01a7 in 49 seconds
More details
- Looked at
228
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier.go:310
- Draft comment:
The function name was changed fromrunLogsListQuery
torunWindowBasedListQuery
, but the comment above still refers to logs. Consider updating the comment for clarity. - Reason this comment was not posted:
Confidence changes required:50%
The function namerunLogsListQuery
was changed torunWindowBasedListQuery
in multiple places, but the comment above it still refers to logs. This should be updated for clarity.
2. pkg/query-service/app/querier/v2/querier.go:310
- Draft comment:
The function name was changed fromrunLogsListQuery
torunWindowBasedListQuery
, but the comment above still refers to logs. Consider updating the comment for clarity. - Reason this comment was not posted:
Confidence changes required:50%
The function namerunLogsListQuery
was changed torunWindowBasedListQuery
in multiple places, but the comment above it still refers to logs. This should be updated for clarity.
3. pkg/query-service/utils/logs.go:12
- Draft comment:
The functionGetLogsListTsRanges
was renamed toGetListTsRanges
, but the typeLogsListTsRange
was not renamed. Consider renaming the type for consistency. - Reason this comment was not posted:
Confidence changes required:50%
The functionGetLogsListTsRanges
was renamed toGetListTsRanges
, but the typeLogsListTsRange
was not renamed. For consistency, consider renaming the type as well.
4. pkg/query-service/utils/logs_test.go:10
- Draft comment:
The test function was renamed toTestListTsRange
, but the test case names still refer to logs. Consider updating the test case names for consistency. - Reason this comment was not posted:
Confidence changes required:50%
The test functionTestLogsListTsRange
was renamed toTestListTsRange
, but the test case names still refer to logs. Consider updating the test case names for consistency.
5. pkg/query-service/app/querier/querier.go:312
- Draft comment:
The functionrunWindowBasedListQuery
usesLogsListTsRange
from theutils
package, which is consistent with the updated function nameGetListTsRanges
. Ensure this change is reflected throughout the codebase. - Reason this comment was not posted:
Confidence changes required:20%
The functionrunWindowBasedListQuery
in bothquerier.go
andv2/querier.go
files is using theLogsListTsRange
type fromutils
package. The functionGetLogsListTsRanges
was renamed toGetListTsRanges
, and the test function was also updated accordingly. This change is consistent across the codebase.
6. pkg/query-service/app/querier/v2/querier.go:312
- Draft comment:
The functionrunWindowBasedListQuery
usesLogsListTsRange
from theutils
package, which is consistent with the updated function nameGetListTsRanges
. Ensure this change is reflected throughout the codebase. - Reason this comment was not posted:
Confidence changes required:20%
The functionrunWindowBasedListQuery
in bothquerier.go
andv2/querier.go
files is using theLogsListTsRange
type fromutils
package. The functionGetLogsListTsRanges
was renamed toGetListTsRanges
, and the test function was also updated accordingly. This change is consistent across the codebase.
Workflow ID: wflow_khr4V0jU0vDE3wFV
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 5077726 in 22 seconds
More details
- Looked at
147
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier.go:318
- Draft comment:
Typo in comment: "se we are considering only one query" should be "we are considering only one query". - Reason this comment was not posted:
Confidence changes required:10%
The code in both files has a typo in the comment on line 318. It says "se we are considering only one query" which should be "we are considering only one query".
2. pkg/query-service/app/querier/v2/querier.go:318
- Draft comment:
Typo in comment: "se we are considering only one query" should be "we are considering only one query". - Reason this comment was not posted:
Confidence changes required:10%
The code in both files has a typo in the comment on line 318. It says "se we are considering only one query" which should be "we are considering only one query".
3. pkg/query-service/app/querier/querier.go:318
- Draft comment:
Typo in comment: replace 'se' with 'we'. - Reason this comment was not posted:
Confidence changes required:10%
TherunWindowBasedListQuery
function in bothquerier.go
andv2/querier.go
files contain a typo in the comment on line 318. The word 'se' should be 'we'.
4. pkg/query-service/app/querier/v2/querier.go:318
- Draft comment:
Typo in comment: replace 'se' with 'we'. - Reason this comment was not posted:
Confidence changes required:10%
TherunWindowBasedListQuery
function in bothquerier.go
andv2/querier.go
files contain a typo in the comment on line 318. The word 'se' should be 'we'.
Workflow ID: wflow_Mtb7UHGHKrSBcsj5
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 373397c in 14 seconds
More details
- Looked at
45
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_H7k9Ag1UC3fu7U6L
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 7366913 in 25 seconds
More details
- Looked at
80
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier.go:338
- Draft comment:
The comment 'this will to run only once' is misleading. The loop iterates over the 'queries' map, so it can run multiple times. Consider removing or correcting this comment. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment seems to be incorrect because the loop iterates over a map, which can have multiple entries. The comment suggests a misunderstanding of the loop's behavior. The comment should likely be removed or corrected to reflect the actual behavior of the loop.
I might be missing some context about the 'queries' map, such as if it is guaranteed to have only one entry in this specific context. However, without explicit evidence in the provided code, the comment appears misleading.
The code does not provide any evidence that the 'queries' map will always have only one entry. Therefore, the comment is misleading and should be removed or corrected.
The comment is misleading because the loop can run multiple times depending on the number of entries in the 'queries' map. The comment should be removed or corrected.
2. pkg/query-service/app/querier/v2/querier.go:338
- Draft comment:
The comment 'this will to run only once' is misleading. The loop iterates over the 'queries' map, so it can run multiple times. Consider removing or correcting this comment. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_o1gmiLANWjDX3BdI
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on b8a803f in 14 seconds
More details
- Looked at
27
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier.go:385
- Draft comment:
The change fromlimit - length
tolimit - uint64(len(data))
ensures that the limit is adjusted based on the actual data length, which is more accurate. This change is consistent in bothquerier.go
andquerier/v2.go
. - Reason this comment was not posted:
Confidence changes required:10%
The change fromlimit - length
tolimit - uint64(len(data))
is consistent in both files. This change ensures that the limit is adjusted based on the actual data length, which is a more accurate representation of the remaining limit.
Workflow ID: wflow_mlLaMu2CChPnVinF
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on dee206c in 44 seconds
More details
- Looked at
600
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier_test.go:1148
- Draft comment:
The test functionTest_querier_runWindowBasedListQuery
is duplicated in bothquerier_test.go
andv2/querier_test.go
. Consider refactoring to avoid duplication. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is speculative as it refers to another file not included in the diff. Without evidence of duplication in the current file, the comment does not provide actionable feedback. The comment does not align with the rules as it is speculative and not based on changes in the current diff.
The comment might be valid if there is indeed a duplication in another file, but without seeing that file, it's impossible to confirm. The comment does not provide enough context or evidence to be actionable.
Even if the comment is correct, it does not pertain to changes made in this diff and lacks evidence. Therefore, it should be removed based on the rules provided.
Remove the comment as it is speculative and not based on changes in the current diff. It lacks evidence and actionable feedback.
Workflow ID: wflow_Zj5BZVKqUjLpytxW
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 62c6c9b in 33 seconds
More details
- Looked at
53
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier_test.go:1131
- Draft comment:
The renaming ofqueryMatcherAny
toregexMatcher
is consistent across both files, which is good. However, the change is purely cosmetic and doesn't affect functionality. Ensure the new name accurately reflects the purpose of the struct, which is to match SQL queries using regex. - Reason this comment was not posted:
Confidence changes required:20%
The renaming ofqueryMatcherAny
toregexMatcher
is consistent across both files, which is good. However, the change is purely cosmetic and doesn't affect functionality. It's important to ensure that the new name accurately reflects the purpose of the struct, which is to match SQL queries using regex.
2. pkg/query-service/app/querier/v2/querier_test.go:1188
- Draft comment:
The renaming ofqueryMatcherAny
toregexMatcher
is consistent across both files, which is good. However, the change is purely cosmetic and doesn't affect functionality. Ensure the new name accurately reflects the purpose of the struct, which is to match SQL queries using regex. - Reason this comment was not posted:
Confidence changes required:20%
The renaming ofqueryMatcherAny
toregexMatcher
is consistent across both files, which is good. However, the change is purely cosmetic and doesn't affect functionality. It's important to ensure that the new name accurately reflects the purpose of the struct, which is to match SQL queries using regex.
3. pkg/query-service/app/querier/querier_test.go:1134
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This applies to theregexMatcher
type definition here and inquerier/v2/querier_test.go
. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is likely incorrect because it refers to a React component file structure, which is not applicable to a Go test file. The comment does not seem to address any changes made in the diff.
I might be missing some context about the project structure, but based on the file content, the comment seems irrelevant.
The file content and the nature of the comment strongly suggest that the comment is misplaced and irrelevant.
The comment should be deleted as it is not relevant to the changes made in the diff.
Workflow ID: wflow_2m0NuCHHYcSoquoP
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Here is a case (i have been trying to come up with countercases against the idea of resetting offset to 0) offset=100, limit =60 [t1-t2] = 50 |
[t1, t2]: 30 traces Offset: 50, Limit: 100 |
Yeah makes sense. To solve this I have a solution where if there is an offset and the result is empty then we do a temporary query with the same filters where limit = offset, and offset=0 to get the count of data that is skipped by offset. and then for the next run, we can say @srikanthccv let me know if this sounds good |
can we do something to reduce the number of roundtrips to db? |
One way I can think of is to not set offset at all, i.e we get the data and skip manually. Which should be fine unless the offset is very huge. |
I am OK with the product restriction that says For any list query, you can only consume X spans at the maximum; beyond that, you need to refine the search. IMO, 10k spans at maximum (all pages considered) in a list query is enough for all practical purposes (except when all 10k belong to the same trace, then it's not very useful because all of them open the same trace detail). Please bring it up in #product-pod and see what people think. Alternatively, to handle large offsets, one option could be to perform a binary search on the tsRanges buckets. This would help identify which set of buckets effectively negate the offset, allowing you to start from the appropriate bucket with the offset reset to zero. |
@srikanthccv you mean that when paginating we go a max of offset 10k and then stop right ? and you are suggesting this implementation ?
|
Yes, assuming everyone is fine with such limitation. |
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.
❌ Changes requested. Incremental review on d3f7c99 in 45 seconds
More details
- Looked at
389
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pkg/query-service/app/querier/v2/querier.go:350
- Draft comment:
Typo in variable nameerrQuriesByName
. Consider renaming toerrQueriesByName
for consistency and clarity. This issue is also present inquerier.go
. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_kmzRauZn9pWXv105
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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! Incremental review on 6bd56b0 in 43 seconds
More details
- Looked at
111
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. pkg/query-service/app/querier/querier.go:351
- Draft comment:
Typo in variable name. Consider renamingerrQuriesByName
toerrQueriesByName
for consistency and clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is about a typo that has already been corrected in the diff. Since the change has been made, the comment is no longer necessary. The comment does not provide any additional value now that the issue is resolved.
I might be missing the context of whether the comment was meant to address a different part of the code that wasn't changed. However, based on the diff, it seems the issue is resolved.
The diff clearly shows that the typo has been corrected, so the comment is outdated and unnecessary.
The comment should be deleted because the typo it addresses has already been corrected in the diff.
2. pkg/query-service/app/querier/querier.go:401
- Draft comment:
Typo in variable name. Consider renamingerrQuriesByName
toerrQueriesByName
for consistency and clarity. - Reason this comment was not posted:
Marked as duplicate.
3. pkg/query-service/app/querier/querier.go:487
- Draft comment:
Typo in variable name. Consider renamingerrQuriesByName
toerrQueriesByName
for consistency and clarity. - Reason this comment was not posted:
Marked as duplicate.
4. pkg/query-service/app/querier/v2/querier.go:351
- Draft comment:
Typo in variable name. Consider renamingerrQuriesByName
toerrQueriesByName
for consistency and clarity. - Reason this comment was not posted:
Marked as duplicate.
5. pkg/query-service/app/querier/v2/querier.go:401
- Draft comment:
Typo in variable name. Consider renamingerrQuriesByName
toerrQueriesByName
for consistency and clarity. - Reason this comment was not posted:
Marked as duplicate.
6. pkg/query-service/app/querier/v2/querier.go:495
- Draft comment:
Typo in variable name. Consider renamingerrQuriesByName
toerrQueriesByName
for consistency and clarity. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_I1QDs2SoP8wlTjvk
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Are you going to implement the 10k restriction separately or do you plan to update the same PR? |
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! Incremental review on 71b2e58 in 55 seconds
More details
- Looked at
148
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. pkg/query-service/constants/constants.go:594
- Draft comment:
The constantTRACE_V4_MAX_PAGINATION_LIMIT
is defined here but not used in this file. Ensure it's used where necessary in other parts of the codebase. - Reason this comment was not posted:
Confidence changes required:10%
The constant TRACE_V4_MAX_PAGINATION_LIMIT is defined but not used in this file. It is used in other files to limit pagination, which is correct.
2. pkg/query-service/app/querier/querier.go:388
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is not relevant to the changes made in the diff. The diff is about Go code, specifically related to query handling, and does not involve any React components or file structure changes. Therefore, the comment should be removed.
I might be missing some context about the overall project structure, but based on the provided diff, the comment is not relevant.
The diff is clearly about Go code, and there is no indication of any React component or file structure changes. The comment is not applicable here.
The comment is not relevant to the changes made in the diff and should be deleted.
3. pkg/query-service/app/querier/v2/querier.go:388
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_wdIgezVRfEIkdh1f
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
I have added it to this PR only @srikanthccv . Sorry for making this PR a pain to review. |
FOR #5713
Adds support for window based pagination for traces.
Important
Adds window-based pagination for trace queries with utility updates and a new schema flag in
querier
andquerier/v2
.querier.go
andquerier/v2.go
.runWindowBasedListQuery()
to handle pagination logic.runBuilderListQueries()
to support trace data sources with pagination.GetLogsListTsRanges()
toGetListTsRanges()
.TestLogsListTsRange()
toTestListTsRange()
.UseTraceNewSchema
flag inquerier
andquerier/v2
to toggle new trace schema support.This description was created by for 71b2e58. It will automatically update as commits are pushed.