Skip to content

Commit 94e9fb5

Browse files
committed
Sends a telemetry events when we skip refreshing of a non-cloud sessions.
We skip refreshing a non-cloud sessions, because we expect it to be a PAT. But now it's rather unexpected situation, so we send an event to be aware about it. (#4315)
1 parent e7f6a14 commit 94e9fb5

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

docs/telemetry-events.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,16 @@ or
531531
}
532532
```
533533

534+
### cloudIntegrations/refreshConnection/skippedNonCloud
535+
536+
> Sent when connection refresh is skipped due to being a non-cloud session
537+
538+
```typescript
539+
{
540+
'integration.id': string
541+
}
542+
```
543+
534544
### cloudIntegrations/settingsOpened
535545

536546
> Sent when a user chooses to manage the cloud integrations

src/constants.telemetry.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ export interface TelemetryEvents extends WebviewShowAbortedEvents, WebviewShownE
8787
/** Sent when a connection session has a missing expiry date */
8888
'cloudIntegrations/refreshConnection/missingExpiry': CloudIntegrationsRefreshConnectionMissingExpiryEvent;
8989

90+
/** Sent when connection refresh is skipped due to being a non-cloud session */
91+
'cloudIntegrations/refreshConnection/skippedNonCloud': CloudIntegrationsNonCloudSessionEvent;
92+
9093
/** Sent when a cloud-based hosting provider is connected */
9194
'cloudIntegrations/hosting/connected': CloudIntegrationsHostingConnectedEvent;
9295
/** Sent when a cloud-based hosting provider is disconnected */
@@ -414,6 +417,10 @@ interface CloudIntegrationsRefreshConnectionMissingExpiryEvent {
414417
'integration.id': string;
415418
}
416419

420+
interface CloudIntegrationsNonCloudSessionEvent {
421+
'integration.id': string;
422+
}
423+
417424
interface CloudIntegrationsHostingConnectedEvent {
418425
'hostingProvider.provider': IntegrationId;
419426
'hostingProvider.key': string;

src/plus/integrations/integration.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,14 @@ export abstract class IntegrationBase<
282282

283283
@log()
284284
async syncCloudConnection(state: 'connected' | 'disconnected', forceSync: boolean): Promise<void> {
285-
if (this._session?.cloud === false) return;
285+
if (this._session?.cloud === false) {
286+
if (this.id !== HostingIntegrationId.GitHub) {
287+
this.container.telemetry.sendEvent('cloudIntegrations/refreshConnection/skippedNonCloud', {
288+
'integration.id': this.id,
289+
});
290+
}
291+
return;
292+
}
286293

287294
switch (state) {
288295
case 'connected':

0 commit comments

Comments
 (0)