Skip to content

Commit da49b2d

Browse files
committed
add Index Failed to mirror Index Created
1 parent 0828207 commit da49b2d

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

packages/compass-indexes/src/modules/regular-indexes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ export function createRegularIndex(
582582
await dispatch(refreshRegularIndexes());
583583
} catch (err) {
584584
dispatch(indexCreationFailed(inProgressIndexId, (err as Error).message));
585+
track('Index Failed', trackEvent, connectionInfoRef.current);
585586
}
586587
};
587588
}

packages/compass-indexes/src/modules/search-indexes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,14 @@ export const createIndex = ({
496496
dispatch(
497497
createSearchIndexFailed(ATLAS_SEARCH_SERVER_ERRORS[error] || error)
498498
);
499+
track(
500+
'Index Failed',
501+
{
502+
atlas_search: true,
503+
type,
504+
},
505+
connectionInfoRef.current
506+
);
499507
return;
500508
}
501509

packages/compass-telemetry/src/telemetry-events.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,62 @@ type IndexCreatedEvent = ConnectionScoped<{
13441344
};
13451345
}>;
13461346

1347+
/**
1348+
* This event is fired when user creates an index and it fails.
1349+
*
1350+
* @category Indexes
1351+
*/
1352+
type IndexFailedEvent = ConnectionScoped<{
1353+
name: 'Index Failed';
1354+
1355+
payload: {
1356+
/**
1357+
* Indicates whether the index is unique.
1358+
*/
1359+
unique?: boolean;
1360+
1361+
/**
1362+
* Specifies the time-to-live (TTL) setting for the index.
1363+
*/
1364+
ttl?: any;
1365+
1366+
/**
1367+
* Indicates whether the index is a columnstore index.
1368+
*/
1369+
columnstore_index?: boolean;
1370+
1371+
/**
1372+
* Indicates if the index has a columnstore projection.
1373+
*/
1374+
has_columnstore_projection?: any;
1375+
1376+
/**
1377+
* Indicates if the index includes a wildcard projection.
1378+
*/
1379+
has_wildcard_projection?: any;
1380+
1381+
/**
1382+
* Specifies if the index uses a custom collation.
1383+
*/
1384+
custom_collation?: any;
1385+
1386+
/**
1387+
* Indicates whether the index is a geospatial index.
1388+
*/
1389+
geo?: boolean;
1390+
1391+
/**
1392+
* Indicates whether the index is an Atlas Search index.
1393+
*/
1394+
atlas_search?: boolean;
1395+
1396+
/**
1397+
* Specifies the type of the index.
1398+
*/
1399+
type?: string;
1400+
};
1401+
}>;
1402+
13471403
/**
13481404
* This event is fired when user updates an index.
13491405
*
@@ -2556,6 +2612,7 @@ export type TelemetryEvent =
25562612
| ImportErrorLogOpenedEvent
25572613
| ImportOpenedEvent
25582614
| IndexCreatedEvent
2615+
| IndexFailedEvent
25592616
| IndexCreateOpenedEvent
25602617
| IndexDroppedEvent
25612618
| IndexEditedEvent

0 commit comments

Comments
 (0)