Skip to content

RI-7218 Add telemetry collection for Create Vector Search Index wizard #4807

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

Conversation

valkirilov
Copy link
Member

Description

Added telemetry collection events to track users' interaction with the Create Vector Search Index wizard

  • when users start the Vector Search onboarding screens (open the wizard to see step 1)
  • when users click to proceed to the step to see the index information (click on "Proceed to index" on step 1)
  • when users request to see the command preview (click "Command preview" on step 2)
  • when users proceed to the Search page, after seeing index information (click "Create index" on step 2)

How to test it

  1. Go to the new Vector Search page (use the magnifier icon from the left side nav)
  2. See the "New vector search" onboarding screen (dispatches VECTOR_SEARCH_ONBOARDING_TRIGGERED)
  3. Click on the "Proceed to index" button, to go to Step 2 (dispatches VECTOR_SEARCH_ONBOARDING_PROCEED_TO_INDEX_INFO)
  4. Click on the "Command preview" button, to see the code that will be executed (dispatches VECTOR_SEARCH_ONBOARDING_VIEW_COMMAND_PREVIEW)
  5. Click on "Create index" button to finish the process (dispatches VECTOR_SEARCH_ONBOARDING_PROCEED_TO_QUERIES)
Screen.Recording.2025-08-05.at.14.48.58.mov

Verify Telemetry events

We have the new events for the Create Vector Search index wizard collected successfully.

Note: Telemetry is collected only if the user decides to opt-in to that.
You control it from Settings page -> Privacy section -> Usage Data toggle.

image

@@ -11,8 +11,8 @@ export interface IBulkActionOverview {
databaseId: string;
duration: number;
type: BulkActionType;
status: BulkActionStatus;
filter: IBulkActionFilterOverview;
status: BulkActionStatus; // Note: This can be null, according to the API response
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, we should update the interface itself, but I was not brave enough to do it at this point, afraid of breaking something unexpected.

@@ -12,6 +12,7 @@ module.exports = {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.scss\\?inline$': '<rootDir>/redisinsight/__mocks__/scssRaw.js',
'uiSrc/(.*)': '<rootDir>/redisinsight/ui/src/$1',
'apiSrc/(.*)': '<rootDir>/redisinsight/api/src/$1',
Copy link
Member Author

Choose a reason for hiding this comment

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

This alias exist for the regular bundler, but was not available for Jest, causing the tests that rely on such imports to fail.

Base automatically changed from fe/feature/RI-7218_vector-search-telemetry to feature/RI-6855/vector-search August 5, 2025 13:25
@valkirilov valkirilov force-pushed the fe/feature/RI-7218_vector-search-telemetry-2 branch from 0661ce5 to 3f64658 Compare August 5, 2025 13:27
@valkirilov valkirilov marked this pull request as ready for review August 5, 2025 13:28
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟢 Statements 81.71% 16240/19873
🟡 Branches 64.88% 7348/11325
🟡 Functions 70.78% 2282/3224
🟢 Lines 81.36% 15278/18778

Copy link
Contributor

github-actions bot commented Aug 5, 2025

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.34% 13797/14942
🟡 Branches 74.02% 4157/5616
🟢 Functions 85.86% 2125/2475
🟢 Lines 92.13% 13190/14317

Test suite run success

2948 tests passing in 286 suites.

Report generated by 🧪jest coverage report action from 30560d7

Copy link
Contributor

github-actions bot commented Aug 5, 2025

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 81.11% 19388/23904
🟡 Branches 66.46% 8411/12656
🟡 Functions 75.03% 5116/6819
🟢 Lines 81.53% 18973/23271

Test suite run success

4952 tests passing in 654 suites.

Report generated by 🧪jest coverage report action from 68252b0

@valkirilov valkirilov self-assigned this Aug 6, 2025
@valkirilov valkirilov force-pushed the fe/feature/RI-7218_vector-search-telemetry-2 branch from bf65847 to f487ba9 Compare August 6, 2025 10:08
@valkirilov valkirilov force-pushed the fe/feature/RI-7218_vector-search-telemetry-2 branch from f487ba9 to 39baa30 Compare August 7, 2025 12:13
@valkirilov valkirilov force-pushed the fe/feature/RI-7218_vector-search-telemetry-2 branch from 39baa30 to 4e8a96b Compare August 7, 2025 12:21
Comment on lines +73 to +87
useEffect(() => {
collectTelemetry(step)
}, [step])

const collectTelemetry = (step: number): void => {
switch (step) {
case 1:
collectStartStepTelemetry()
break
case 2:
collectIndexInfoStepTelemetry()
break
case 3:
collectCreateIndexStepTelemetry()
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not a big fan of this. It's not even code that's worth extracting to a custom hook (all the telemetry callbacks).
I think it's better to have a single method, defined outside this component/file. On step change - call it with all params, let it decide what to track

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I wanted to do the same, but in order to extract them as a custom hook, we should prop drill all the state params (necessary for the telemetry to work), and at the same time, we don't have a shared context to do it in a clean way. This is the "best" I could do without additional refactoring of the main state.

Copy link
Collaborator

Choose a reason for hiding this comment

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

not a hook but a method is what I suggested. Having these functions inside the component increase it's complexity unneededly

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I made some refactoring in e554f1a to offload the current component, as you suggested. I moved it out to a hook (instead of just a function) so we can pass down less props (like instanceId).

Let me know if that was what you suggested 🙂

@valkirilov valkirilov merged commit b4b839f into feature/RI-6855/vector-search Aug 7, 2025
12 checks passed
@valkirilov valkirilov deleted the fe/feature/RI-7218_vector-search-telemetry-2 branch August 7, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants