-
Notifications
You must be signed in to change notification settings - Fork 258
chore(telemetry): add filter tracking for bulk ops COMPASS-10297 #8015
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1204,6 +1204,7 @@ class CrudStoreImpl | |
| 'Bulk Update Executed', | ||
| { | ||
| isUpdatePreviewSupported: this.state.isUpdatePreviewSupported, | ||
| has_filter: !!this.queryBar.getLastAppliedQuery('crud').filter, | ||
| }, | ||
| this.connectionInfoRef.current | ||
| ); | ||
|
|
@@ -1956,7 +1957,13 @@ class CrudStoreImpl | |
| } | ||
|
|
||
| async runBulkDelete() { | ||
| this.track('Bulk Delete Executed', {}, this.connectionInfoRef.current); | ||
| this.track( | ||
| 'Bulk Delete Executed', | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think both of these events should be called either after the operation succeeds or just before it (dataservice call). In delete event we show a confirmation modal, to which user can ignore and we still track it. Similarly for update, if the query is invalid, we still track it. |
||
| { | ||
| has_filter: !!this.queryBar.getLastAppliedQuery('crud').filter, | ||
| }, | ||
|
mabaasit marked this conversation as resolved.
|
||
| this.connectionInfoRef.current | ||
| ); | ||
|
|
||
| const { affected } = this.state.bulkDelete; | ||
| this.closeBulkDeleteDialog(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -998,6 +998,8 @@ type BulkUpdateExecutedEvent = ConnectionScopedEvent<{ | |
| * Specifies if update preview was supported (the update preview runs inside a transaction.) | ||
| */ | ||
| isUpdatePreviewSupported: boolean; | ||
| /** Specifies if a filter was set in the query */ | ||
| has_filter: boolean; | ||
| }; | ||
| }>; | ||
|
|
||
|
|
@@ -1018,7 +1020,10 @@ type BulkDeleteOpenedEvent = ConnectionScopedEvent<{ | |
| */ | ||
| type BulkDeleteExecutedEvent = ConnectionScopedEvent<{ | ||
| name: 'Bulk Delete Executed'; | ||
| payload: Record<string, never>; | ||
| payload: { | ||
| /** Specifies if a filter was set in the query */ | ||
| has_filter: boolean; | ||
| }; | ||
|
Comment on lines
1022
to
+1026
|
||
| }>; | ||
|
|
||
| /** | ||
|
|
||
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.
has_filteris computed using!!...filter, butgetLastAppliedQuery()returns a query object wherefilteris always an object (often{}), which is truthy. This will reporthas_filter: trueeven when no filter is set. Compute it like the existingQuery Executedtelemetry does (e.g.,Object.keys(filter ?? {}).length > 0) by first grabbingconst { filter } = this.queryBar.getLastAppliedQuery('crud').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.
Copilot is right here, filter can be
{}which would be truthy.'Query Executed'has the same pattern.