diff --git a/src/constants.ts b/src/constants.ts index 5df4dbc..a2d3552 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -470,3 +470,21 @@ export const enum Schemes { VslsScc = 'vsls-scc', Virtual = 'vscode-vfs', } + +export type TelemetryEvents = + | 'account/validation/failed' + | 'activate' + | 'command' + | 'command/core' + | 'remoteProviders/connected' + | 'remoteProviders/disconnected' + | 'providers/changed' + | 'providers/context' + | 'providers/registrationComplete' + | 'repositories/changed' + | 'repositories/visibility' + | 'repository/opened' + | 'repository/visibility' + | 'subscription' + | 'subscription/changed' + | 'usage/track'; diff --git a/src/telemetry/telemetry.ts b/src/telemetry/telemetry.ts index 0ec8db3..92347ff 100644 --- a/src/telemetry/telemetry.ts +++ b/src/telemetry/telemetry.ts @@ -3,6 +3,7 @@ import type { Disposable } from 'vscode'; import { version as codeVersion, env } from 'vscode'; import { getProxyAgent } from '@env/fetch'; import { getPlatform } from '@env/platform'; +import type { TelemetryEvents } from '../constants'; import type { Container } from '../container'; import { configuration } from '../system/configuration'; @@ -30,7 +31,7 @@ export interface TelemetryProvider extends Disposable { interface QueuedEvent { type: 'sendEvent'; - name: string; + name: TelemetryEvents; data?: Record; global: Map; startTime: TimeInput; @@ -129,7 +130,7 @@ export class TelemetryService implements Disposable { } sendEvent( - name: string, + name: TelemetryEvents, data?: Record, startTime?: TimeInput, endTime?: TimeInput, @@ -152,7 +153,7 @@ export class TelemetryService implements Disposable { } startEvent( - name: string, + name: TelemetryEvents, data?: Record, startTime?: TimeInput, ): Disposable | undefined {