diff --git a/packages/compass-indexes/src/modules/regular-indexes.ts b/packages/compass-indexes/src/modules/regular-indexes.ts index 74bac7cf48d..8efe1c0af90 100644 --- a/packages/compass-indexes/src/modules/regular-indexes.ts +++ b/packages/compass-indexes/src/modules/regular-indexes.ts @@ -582,6 +582,7 @@ export function createRegularIndex( await dispatch(refreshRegularIndexes()); } catch (err) { dispatch(indexCreationFailed(inProgressIndexId, (err as Error).message)); + track('Index Create Failed', trackEvent, connectionInfoRef.current); } }; } diff --git a/packages/compass-indexes/src/modules/search-indexes.ts b/packages/compass-indexes/src/modules/search-indexes.ts index bdc4acffd92..7925f05a05c 100644 --- a/packages/compass-indexes/src/modules/search-indexes.ts +++ b/packages/compass-indexes/src/modules/search-indexes.ts @@ -496,6 +496,14 @@ export const createIndex = ({ dispatch( createSearchIndexFailed(ATLAS_SEARCH_SERVER_ERRORS[error] || error) ); + track( + 'Index Create Failed', + { + atlas_search: true, + type, + }, + connectionInfoRef.current + ); return; } diff --git a/packages/compass-telemetry/src/telemetry-events.ts b/packages/compass-telemetry/src/telemetry-events.ts index 2975f205095..26dbd1394d6 100644 --- a/packages/compass-telemetry/src/telemetry-events.ts +++ b/packages/compass-telemetry/src/telemetry-events.ts @@ -1344,6 +1344,62 @@ type IndexCreatedEvent = ConnectionScoped<{ }; }>; +/** + * This event is fired when user creates an index and it fails. + * + * @category Indexes + */ +type IndexCreateFailedEvent = ConnectionScoped<{ + name: 'Index Create Failed'; + + payload: { + /** + * Indicates whether the index is unique. + */ + unique?: boolean; + + /** + * Specifies the time-to-live (TTL) setting for the index. + */ + ttl?: any; + + /** + * Indicates whether the index is a columnstore index. + */ + columnstore_index?: boolean; + + /** + * Indicates if the index has a columnstore projection. + */ + has_columnstore_projection?: any; + + /** + * Indicates if the index includes a wildcard projection. + */ + has_wildcard_projection?: any; + + /** + * Specifies if the index uses a custom collation. + */ + custom_collation?: any; + + /** + * Indicates whether the index is a geospatial index. + */ + geo?: boolean; + + /** + * Indicates whether the index is an Atlas Search index. + */ + atlas_search?: boolean; + + /** + * Specifies the type of the index. + */ + type?: string; + }; +}>; + /** * This event is fired when user updates an index. * @@ -2556,6 +2612,7 @@ export type TelemetryEvent = | ImportErrorLogOpenedEvent | ImportOpenedEvent | IndexCreatedEvent + | IndexCreateFailedEvent | IndexCreateOpenedEvent | IndexDroppedEvent | IndexEditedEvent