Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/tracking-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@ This event is fired when user successfully connects to a new server/cluster.
- The OS family of the connected server.
- **topology_type** (required): `string`
- The type of connected topology.
- **num_active_connections** (required): `number`
- The number of active connections.
- **num_inactive_connections** (required): `number`
- The number of inactive connections.
- **auth_type** (optional): `string | undefined`
- Desktop only. The authentication type used in the connection.
- **tunnel** (optional): `string | undefined`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,16 @@ const connectWithOptions = (
getExtraConnectionData(connectionInfo),
]);

const connections = getState().connections;
// Counting all connections, we need to filter out any connections currently being created
const totalConnectionsCount = Object.values(
connections.byId
).filter(({ isBeingCreated }) => !isBeingCreated).length;
const activeConnectionsCount =
getActiveConnectionsCount(connections);
const inactiveConnectionsCount =
totalConnectionsCount - activeConnectionsCount;

return {
is_atlas: isAtlas,
atlas_hostname: isAtlas ? resolvedHostname : null,
Expand All @@ -1751,6 +1761,8 @@ const connectWithOptions = (
server_arch: host.arch,
server_os_family: host.os_family,
topology_type: dataService.getCurrentTopologyType(),
num_active_connections: activeConnectionsCount,
num_inactive_connections: inactiveConnectionsCount,
...extraInfo,
};
},
Expand Down
10 changes: 10 additions & 0 deletions packages/compass-telemetry/src/telemetry-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,16 @@ type NewConnectionEvent = ConnectionScoped<{
* The type of connected topology.
*/
topology_type: string;

/**
* The number of active connections.
*/
num_active_connections: number;

/**
* The number of inactive connections.
*/
num_inactive_connections: number;
} & ExtraConnectionData;
}>;

Expand Down
Loading