-
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(errors): Allow searching for errors #25175
base: master
Are you sure you want to change the base?
Conversation
Size Change: 0 B Total Size: 9.21 MB ℹ️ View Unchanged
|
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
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.
Some minor things but overall looks good. Approving for when you're happy with the debouncing, nothing else blocking
@@ -1523,6 +1523,7 @@ export interface ErrorTrackingQuery extends DataNode<ErrorTrackingQueryResponse> | |||
assignee?: integer | null | |||
filterGroup?: PropertyGroupFilter | |||
filterTestAccounts?: boolean | |||
searchQuery?: string |
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.
Agreed this makes sense as being separate to the filterGroup
ast.CompareOperation( | ||
op=ast.CompareOperationOp.Gt, |
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.
Not a concern for right now but maybe we could consider some degree of fuzzy matching in future
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.
nice 👌
|
||
self.assertEqual(len(results), 1) | ||
self.assertEqual(results[0]["fingerprint"], ["DatabaseNotFound"]) | ||
self.assertEqual(results[0]["occurrences"], 1) |
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.
I think the negative case is only implicitly tested e.g. what happens when the search query doesn't match - do we get 0 results?
@@ -37,7 +37,9 @@ def to_query(self) -> ast.SelectQuery: | |||
|
|||
def select(self): | |||
exprs: list[ast.Expr] = [ | |||
ast.Alias(alias="occurrences", expr=ast.Call(name="count", args=[])), | |||
ast.Alias( | |||
alias="occurrences", expr=ast.Call(name="count", distinct=True, args=[ast.Field(chain=["uuid"])]) |
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.
@daibhin found that due to the left outer join
for overrides, sometimes events are double counted, which makes this new test I added flakey. Not sure why this doesn't happen on existing tests 🤔 , maybe to do with how/when overrides are set, since I add events after the first flush.
But anyhow, should make this case clear where we never doublecount events.
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Problem
^^ Opted to add this to the query runner rather than manipulate filter groups in the frontend because I imagine this can get complicated. Easier to isolate, test and update this logic as and when the search function changes in the backend.
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?