Skip to content
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: add search span scope in the list view tab to add the scope at per Query level #6810

Merged
merged 14 commits into from
Jan 20, 2025

Conversation

eKuG
Copy link
Contributor

@eKuG eKuG commented Jan 13, 2025

Summary

Capability we want to introduce with these change:

  • Add the search span scope in the query level.
  • The scope should include but not limited to searching on all spans, entrypoint spans and root spans
  • The code should be extensible. We can update the code whenever there is new requirement without changing the user experience.

Related Issues / PR's

#3267

Screenshots

NA

Affected Areas and Manually Tested Areas

The changes to the query range api will be as followed:

There is practically no change on the API contract.
The span search scope for onlyRoot spans would be :

                        {
                            "id": "16c2e2da",
                            "key": {
                                "key": "isRoot",
                                "dataType": "",
                                "isColumn": false,
                                "type": "spanSearchScope"
                            },
                            "op": "=",
                            "value": "true"
                        }
                    ],

The span search scope for EntryPoint spans would be :

"items": [
                        {
                            "id": "16c2e2da",
                            "key": {
                                "key": "isEntryPoint",
                                "dataType": "",
                                "isColumn": false,
                                "type": "spanSearchScope"
                            },
                            "op": "=",
                            "value": "true"
                        }
                    ],

We have introduced a new attibute for the type field in the key object of items which is spanSearchScope which will only work when the key is either isRoot or isEntryPoint

More information can be found at this document : Notion Document


Important

Add search span scope at query level to filter by root and entry point spans using new spanSearchScope attribute type.

  • Behavior:
    • Introduces spanSearchScope attribute type in v3.go for filtering spans by scope.
    • Adds buildSpanScopeQuery() in query_builder.go to handle spanSearchScope attributes, supporting isRoot and isEntryPoint keys.
    • Updates buildTracesQuery() in query_builder.go to integrate span scope queries.
  • Constants:
    • Adds SpanSearchScopeRoot and SpanSearchScopeEntryPoint constants in constants.go.
  • Tests:
    • Adds test cases in query_builder_test.go for buildTracesQuery() to verify span scope filtering for root and entry point spans.

This description was created by Ellipsis for 89159a5. It will automatically update as commits are pushed.

@github-actions github-actions bot added docs required enhancement New feature or request labels Jan 13, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 0346e52 in 2 minutes and 1 seconds

More details
  • Looked at 77 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/query-service/model/v3/v3.go:34
  • Draft comment:
    The SpanSearchScope type and its constants are defined in both pkg/query-service/app/traces/v4/query_builder.go and pkg/query-service/model/v3/v3.go. Consider defining them in one place to avoid redundancy.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests there may be code duplication, but I can't verify this since I don't have access to the other file. The rules state that if understanding requires more context or seeing other files, we should delete the comment. Additionally, this seems like a cross-file issue which the rules explicitly say to ignore.
    I could be wrong about this being a cross-file issue - maybe having duplicate type definitions is a serious enough problem that it should be flagged regardless. The comment could be helping prevent maintenance issues.
    While duplicate type definitions can be problematic, the rules explicitly state to ignore cross-file issues and to delete comments if we need more context from other files to verify them. We must follow these rules.
    Delete this comment since it requires seeing another file to verify and involves a cross-file issue, both of which are explicitly against the review rules.

Workflow ID: wflow_KGDrTd6ZZKUanQ1K


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.

pkg/query-service/app/traces/v4/query_builder.go Outdated Show resolved Hide resolved
pkg/query-service/app/traces/v4/query_builder.go Outdated Show resolved Hide resolved
@ankitnayan
Copy link
Collaborator

add tests?

@ankitnayan ankitnayan removed their request for review January 13, 2025 13:53
@eKuG
Copy link
Contributor Author

eKuG commented Jan 13, 2025

@ankitnayan tests are added

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 75b4d89 in 1 minute and 7 seconds

More details
  • Looked at 45 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder_test.go:552
  • Draft comment:
    Avoid using the component/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 entire file.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_P6Y4fCrbPHmfsaer


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.

pkg/query-service/app/traces/v4/query_builder_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 6ea3a32 in 23 seconds

More details
  • Looked at 45 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder_test.go:552
  • Draft comment:
    The test cases for entry_point_spans and root_spans have been removed. Ensure that equivalent test cases are added to cover the new functionality for spanSearchScope. This is crucial to maintain test coverage for these scenarios.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. pkg/query-service/app/traces/v4/query_builder_test.go:552
  • Draft comment:
    Avoid using the component/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 entire file.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_zDYVgMpir9mQ1Rbb


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Member

@nityanandagohain nityanandagohain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add tests

pkg/query-service/app/traces/v4/query_builder.go Outdated Show resolved Hide resolved
pkg/query-service/app/traces/v4/query_builder.go Outdated Show resolved Hide resolved
pkg/query-service/app/traces/v4/query_builder.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 715af78 in 51 seconds

More details
  • Looked at 39 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder.go:226
  • Draft comment:
    The conversion of keyName to lowercase is redundant since the constants SpanSearchScopeRoot and SpanSearchScopeEntryPoint are already defined in lowercase. Consider removing strings.ToLower here.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    Without seeing the constants package, I can't verify if SpanSearchScopeRoot and SpanSearchScopeEntryPoint are defined in lowercase. Even if they are currently lowercase, having the ToLower() call provides safety against future changes to the constants. It's a defensive programming practice that costs very little performance.
    I could be wrong about the defensive programming value - if the constants are truly meant to be lowercase by design, then the ToLower() call adds unnecessary complexity.
    The cost of the ToLower() call is negligible, and it provides protection against future changes or additions to the constants. Better to be safe than sorry in this case.
    The comment should be deleted. Without being able to verify the constants are guaranteed to be lowercase, removing the ToLower() call could introduce subtle bugs if the constants ever change.
2. pkg/query-service/constants/constants.go:57
  • Draft comment:
    The constants SpanSearchScopeRoot and SpanSearchScopeEntryPoint are now defined in lowercase. Ensure that all references to these constants in the codebase are updated to match this change.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. pkg/query-service/app/traces/v4/query_builder.go:230
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values to maintain consistency in design and theming. This is also applicable at line 231.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_0T6GeyFOyeHKmKdT


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@eKuG
Copy link
Contributor Author

eKuG commented Jan 20, 2025

@nityanandagohain Addressed all comments. Also added tests

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 09dea8d in 51 seconds

More details
  • Looked at 43 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder_test.go:579
  • Draft comment:
    Typo in 'v3.AttributeKetTypeSpanSearchScope', should be 'v3.AttributeKeyTypeSpanSearchScope'.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_ZVvPsTn6xrR9MCQa


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.

pkg/query-service/app/traces/v4/query_builder_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 a9959e0 in 47 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder.go:96
  • Draft comment:
    Avoid using the component/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_8x08AFTjWGiJngBH


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.

pkg/query-service/app/traces/v4/query_builder.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 47d864f in 36 seconds

More details
  • Looked at 57 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder.go:97
  • Draft comment:
    Typo in AttributeKetTypeSpanSearchScope. It should be AttributeKeyTypeSpanSearchScope. This typo is present in multiple places.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. pkg/query-service/app/traces/v4/query_builder.go:97
  • Draft comment:
    Typo in constant name AttributeKetTypeSpanSearchScope. It should be AttributeKeyTypeSpanSearchScope. This typo is also present in query_builder_test.go and v3.go.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_ibmQNyGkSVZ9dnq3


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 1f650e3 in 40 seconds

More details
  • Looked at 27 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder_test.go:601
  • Draft comment:
    The expected SQL query for 'test noop list view with root_spans with other attributes' should include a check for the 'isRoot' attribute. Ensure that the 'parent_span_id = ''' condition is present in the expected query.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. pkg/query-service/app/traces/v4/query_builder_test.go:584
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values to maintain consistency in design and theming. This applies to the test case added in the diff.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_pOosqRBbWcuix2Ol


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 bdaaabc in 16 seconds

More details
  • Looked at 21 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder.go:238
  • Draft comment:
    The final return "", nil is redundant since the function already returns within the loop for valid cases. Consider removing it for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The return statement at the end of the loop is redundant since the function already returns within the loop for valid cases. This can be simplified.
2. pkg/query-service/app/traces/v4/query_builder.go:238
  • Draft comment:
    The final return statement in buildSpanScopeQuery is redundant as the function already returns within the loop for valid cases.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function buildSpanScopeQuery is correctly handling the span search scope attributes and returning appropriate queries based on the scope type. However, the return statement at the end of the function is redundant because the function already returns within the loop for valid cases.

Workflow ID: wflow_3ngsVNl6zsbCCoBX


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 89159a5 in 42 seconds

More details
  • Looked at 27 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder_test.go:601
  • Draft comment:
    The expected SQL query does not reflect the presence of both 'isRoot' and 'isEntryPoint' filters. Ensure the query includes conditions for both filters.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. pkg/query-service/app/traces/v4/query_builder_test.go:584
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values to maintain consistency in design and theming. This applies to the test case added in this PR.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_IqFpxV1mRduknwqd


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@eKuG eKuG requested a review from nityanandagohain January 20, 2025 11:59
@eKuG eKuG enabled auto-merge (squash) January 20, 2025 12:26
@eKuG eKuG merged commit 044a124 into main Jan 20, 2025
16 checks passed
@eKuG eKuG deleted the feat-span-search-scope branch January 20, 2025 12:34
grandwizard28 added a commit that referenced this pull request Jan 20, 2025
feat: add search span scope in the list view tab to add the scope at per Query level (#6810)

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

chore(install-script): install.sh script improvements (#6857)

- support for docker compose plugin
- check for occupied port when installing SigNoz for the first time
- remove unused code

Signed-off-by: Prashant Shahi <[email protected]>

chore: correct order within page result (#6847)
amlannandy pushed a commit that referenced this pull request Jan 21, 2025
…per Query level (#6810)

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level

* feat: add search span scope in the list view tab to add the scope at per query level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs shipped enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants