Skip to content

Commit 68fc3d6

Browse files
authored
Merge branch 'main' into search-index-might-not-exist
2 parents 50fa4bc + 1df46fd commit 68fc3d6

File tree

4 files changed

+97
-1
lines changed

4 files changed

+97
-1
lines changed

docs/tracking-plan.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Compass Tracking Plan
33

4-
Generated on Mon, Oct 14, 2024 at 08:39 AM
4+
Generated on Mon, Oct 14, 2024 at 12:23 PM
55

66
## Table of Contents
77

@@ -113,6 +113,7 @@ Generated on Mon, Oct 14, 2024 at 08:39 AM
113113

114114
### Indexes
115115
- [Index Created](#event--IndexCreatedEvent)
116+
- [Index Create Failed](#event--IndexCreateFailedEvent)
116117
- [Index Create Opened](#event--IndexCreateOpenedEvent)
117118
- [Index Dropped](#event--IndexDroppedEvent)
118119
- [Index Edited](#event--IndexEditedEvent)
@@ -1462,6 +1463,35 @@ This event is fired when user creates an index.
14621463

14631464
**Properties**:
14641465

1466+
- **unique** (optional): `boolean | undefined`
1467+
- Indicates whether the index is unique.
1468+
- **ttl** (optional): `any`
1469+
- Specifies the time-to-live (TTL) setting for the index.
1470+
- **columnstore_index** (optional): `boolean | undefined`
1471+
- Indicates whether the index is a columnstore index.
1472+
- **has_columnstore_projection** (optional): `any`
1473+
- Indicates if the index has a columnstore projection.
1474+
- **has_wildcard_projection** (optional): `any`
1475+
- Indicates if the index includes a wildcard projection.
1476+
- **custom_collation** (optional): `any`
1477+
- Specifies if the index uses a custom collation.
1478+
- **geo** (optional): `boolean | undefined`
1479+
- Indicates whether the index is a geospatial index.
1480+
- **atlas_search** (optional): `boolean | undefined`
1481+
- Indicates whether the index is an Atlas Search index.
1482+
- **type** (optional): `string | undefined`
1483+
- Specifies the type of the index.
1484+
- **connection_id** (optional): `string | undefined`
1485+
- The id of the connection associated to this event.
1486+
1487+
<a name="event--IndexCreateFailedEvent"></a>
1488+
1489+
### Index Create Failed
1490+
1491+
This event is fired when user creates an index and it fails.
1492+
1493+
**Properties**:
1494+
14651495
- **unique** (optional): `boolean | undefined`
14661496
- Indicates whether the index is unique.
14671497
- **ttl** (optional): `any`

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 Create 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 Create 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 IndexCreateFailedEvent = ConnectionScoped<{
1353+
name: 'Index Create 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+
| IndexCreateFailedEvent
25592616
| IndexCreateOpenedEvent
25602617
| IndexDroppedEvent
25612618
| IndexEditedEvent

0 commit comments

Comments
 (0)