@@ -13,7 +13,7 @@ import { configuration } from '../../system/configuration';
1313import { gate } from '../../system/decorators/gate' ;
1414import { debug , log } from '../../system/decorators/log' ;
1515import { promisifyDeferred , take } from '../../system/event' ;
16- import { filterMap , flatten } from '../../system/iterable' ;
16+ import { filterMap , flatten , join } from '../../system/iterable' ;
1717import { Logger } from '../../system/logger' ;
1818import { getLogScope } from '../../system/logger.scope' ;
1919import { openUrl } from '../../system/utils' ;
@@ -95,7 +95,12 @@ export class IntegrationService implements Disposable {
9595 const connections = await cloudIntegrations ?. getConnections ( ) ;
9696 if ( connections == null ) return ;
9797
98- connections . map ( p => connectedIntegrations . add ( toIntegrationId [ p . provider ] ) ) ;
98+ connections . map ( p => {
99+ const integrationId = toIntegrationId [ p . provider ] ;
100+ // GKDev includes some integrations like "google" that we don't support
101+ if ( integrationId == null ) return ;
102+ connectedIntegrations . add ( toIntegrationId [ p . provider ] ) ;
103+ } ) ;
99104 }
100105
101106 for await ( const integration of this . getSupportedCloudIntegrations ( ) ) {
@@ -104,6 +109,14 @@ export class IntegrationService implements Disposable {
104109 forceConnect ,
105110 ) ;
106111 }
112+
113+ if ( this . container . telemetry . enabled ) {
114+ this . container . telemetry . setGlobalAttributes ( {
115+ 'cloudIntegrations.connectedCount' : connectedIntegrations . size ,
116+ 'cloudIntegrations.connectedIds' : join ( connectedIntegrations . values ( ) , ',' ) ,
117+ } ) ;
118+ }
119+
107120 return connectedIntegrations ;
108121 }
109122
@@ -149,9 +162,16 @@ export class IntegrationService implements Disposable {
149162 take (
150163 window . onDidChangeWindowState ,
151164 2 ,
152- ) ( e => {
165+ ) ( async e => {
153166 if ( e . focused ) {
154- void this . syncCloudIntegrations ( true ) ;
167+ const connected = await this . syncCloudIntegrations ( true ) ;
168+ if ( this . container . telemetry . enabled ) {
169+ this . container . telemetry . sendEvent (
170+ 'cloudIntegrations/connected' ,
171+ { 'integration.ids' : connected ? join ( connected . values ( ) , ',' ) : undefined } ,
172+ source ,
173+ ) ;
174+ }
155175 }
156176 } ) ;
157177 }
@@ -269,7 +289,14 @@ export class IntegrationService implements Disposable {
269289 if ( account == null ) return false ;
270290 }
271291
272- await this . syncCloudIntegrations ( true ) ;
292+ const connected = await this . syncCloudIntegrations ( true ) ;
293+ if ( this . container . telemetry . enabled ) {
294+ this . container . telemetry . sendEvent (
295+ 'cloudIntegrations/connected' ,
296+ { 'integration.ids' : connected ? join ( connected . values ( ) , ',' ) : undefined } ,
297+ source ,
298+ ) ;
299+ }
273300
274301 if ( integrationIds != null ) {
275302 for ( const integrationId of integrationIds ) {
0 commit comments