-
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: added support for filterBy in trace tab such as filterBy spanCount #6374
base: develop
Are you sure you want to change the base?
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 42e7faa in 54 seconds
More details
- Looked at
157
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/query-service/model/v3/v3.go:380
- Draft comment:
TheFilterBy
parameter is added but not used in any logic or query construction. Ensure it is utilized or remove it to avoid confusion. - Reason this comment was not posted:
Comment did not seem useful.
2. pkg/query-service/model/v3/v3.go:380
- Draft comment:
TheFilterBy
field inQueryRangeParamsV3
is not used in the codebase. Consider removing it to maintain clean code. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_8CoFwUGy3oX38HkO
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 c2e7e91 in 39 seconds
More details
- Looked at
55
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. pkg/query-service/app/traces/v3/query_builder.go:368
- Draft comment:
Remove commented-out code to improve readability and maintainability. - Reason this comment was not posted:
Confidence changes required:50%
The code contains commented-out lines that are not needed and should be removed for clarity and cleanliness.
2. pkg/query-service/app/traces/v3/query_builder.go:369
- Draft comment:
Ensure that SQL query construction is safe from SQL injection vulnerabilities by using parameterized queries or proper escaping. - Reason this comment was not posted:
Comment did not seem useful.
3. pkg/query-service/app/traces/v3/query_builder.go:358
- Draft comment:
Consider documenting the default limit behavior or ensure it's the intended behavior when limit is set to 0. - Reason this comment was not posted:
Confidence changes required:30%
The code uses a default limit of 100 if the limit is set to 0. This behavior should be documented or reconsidered if it's not the intended behavior.
4. pkg/query-service/app/traces/v3/query_builder.go:353
- 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. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_wx127ywEe55WrcsG
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 d57d5ab in 41 seconds
More details
- Looked at
53
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/query-service/app/traces/v3/query_builder_test.go:1196
- Draft comment:
TheFilterBy
parameter is added to the function call but is not utilized in the test logic. Ensure that theFilterBy
parameter is properly integrated into the test cases to validate its functionality. This issue is also present inTestPrepareTracesQuery
. - Reason this comment was not posted:
Comment did not seem useful.
2. pkg/query-service/app/traces/v3/query_builder_test.go:491
- 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 the overall file structure. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_BAFwOmRDcBEuoWIT
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 fd31605 in 1 minute and 14 seconds
More details
- Looked at
20
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/query-service/app/traces/v3/query_builder_test.go:1200
- Draft comment:
Remove the commented-out code block as it seems to be a leftover and is not needed. - Reason this comment was not posted:
Confidence changes required:50%
The commented-out code block seems to be a leftover and should be removed for code cleanliness.
2. pkg/query-service/app/traces/v3/query_builder_test.go:1200
- Draft comment:
Remove the commented-out code block to keep the code clean and maintainable. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_oywcCxJ1VxW4LEYZ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@eKuG I see two issues with this change.
This is not going to work at scale. We can't do a group by a very high cardinal column at query. The number of traces can go from a few tens of millions to several hundred million and billions easily. Adding such a column in a group by is not an option because there won't be enough memory. Did you test this on a few billion traces or several hundred million traces at least?
I would assume the capability should support the ability to specify the span count in the request, for example, give me traces with span count > 1000 and < 2000. I don't see how that's supported. |
Hey @srikanthccv Lets talk about the second point first. My final query was looking something like this. So the span_count > x will be present in the where clause with the timestamp.
For second point, do let me know what you think should be the best approach for the same? I tested this query on approximately 200M traces and it perfromed as expected. Let me see, if we can optimise this query somehow. |
Please share how this is achieved in the code.
Please help me understand the performed as expected part. Have you folks discussed some pre-requisite in terms of resources needed and how you would have billions of traceIDs? From my experience, anything beyond 10 million rows in the group by questionable and beyond 25 mil is where the line should be drawn in most cases. Unless the enormous amount of memory availability, the 200M should have crashed with memory error. Edit: I see that query only needs to maintain count and duration for state so it might require comparatively less memory but it can OOM kill ClickHouse when the total traces id can't fit in memory |
I don't think grouping by traceID at the query time is an option for us. I believe @nityanandagohain has created some summary tables as a part of traces v3, which helps specifically with count; please check with him once. |
@srikanthccv According to the document I have written on notion, it should have been having instead of where for Span_count. |
Summary
Solves #3174
Related Issues / PR's
Screenshots
NA
Affected Areas and Manually Tested Areas
Important
Add support for filtering trace queries by
spanCount
using a newfilterBy
parameter in query functions.filterBy
parameter torunBuilderQuery()
inhelper.go
andv2/helper.go
to support filtering byspanCount
.PrepareTracesQuery()
inquery_builder.go
andtraces/v3/query_builder.go
to acceptfilterBy
and incorporate it into query construction.FilterBy
field toQueryRangeParamsV3
inv3.go
to store filter criteria.buildTracesQuery()
intraces/v3/query_builder.go
to handlefilterBy
parameter.filterBy
inquery_builder.go
andtraces/v3/query_builder.go
.This description was created by for fd31605. It will automatically update as commits are pushed.