Skip to content

Commit e7f6a14

Browse files
committed
Adds a new telemetry event for missing expiry dates
(#4315)
1 parent e63888c commit e7f6a14

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

docs/telemetry-events.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,16 @@ or
521521
}
522522
```
523523

524+
### cloudIntegrations/refreshConnection/missingExpiry
525+
526+
> Sent when a connection session has a missing expiry date
527+
528+
```typescript
529+
{
530+
'integration.id': string
531+
}
532+
```
533+
524534
### cloudIntegrations/settingsOpened
525535

526536
> 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
@@ -84,6 +84,9 @@ export interface TelemetryEvents extends WebviewShowAbortedEvents, WebviewShownE
8484
/** Sent when refreshing a provider token from the api fails */
8585
'cloudIntegrations/refreshConnection/failed': CloudIntegrationsRefreshConnectionFailedEvent;
8686

87+
/** Sent when a connection session has a missing expiry date */
88+
'cloudIntegrations/refreshConnection/missingExpiry': CloudIntegrationsRefreshConnectionMissingExpiryEvent;
89+
8790
/** Sent when a cloud-based hosting provider is connected */
8891
'cloudIntegrations/hosting/connected': CloudIntegrationsHostingConnectedEvent;
8992
/** Sent when a cloud-based hosting provider is disconnected */
@@ -407,6 +410,10 @@ interface CloudIntegrationsRefreshConnectionFailedEvent {
407410
'integration.id': string | undefined;
408411
}
409412

413+
interface CloudIntegrationsRefreshConnectionMissingExpiryEvent {
414+
'integration.id': string;
415+
}
416+
410417
interface CloudIntegrationsHostingConnectedEvent {
411418
'hostingProvider.provider': IntegrationId;
412419
'hostingProvider.key': string;

src/plus/integrations/integration.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ export abstract class IntegrationBase<
336336
} catch (ex) {
337337
Logger.error(ex, scope);
338338
}
339+
} else if (this._session?.expiresAt == null && this.id !== HostingIntegrationId.GitHub) {
340+
this.container.telemetry.sendEvent('cloudIntegrations/refreshConnection/missingExpiry', {
341+
'integration.id': this.id,
342+
});
339343
}
340344
}
341345

0 commit comments

Comments
 (0)