Skip to content

Commit a5b5587

Browse files
authored
Use createTelemetryLogger api (#65)
* Use createTelemetryLogger api * Fix anonymize data for sendTelemetryException * 💄
1 parent 67f1a3e commit a5b5587

17 files changed

+408
-610
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"url": "https://github.com/gitpod-io/gitpod/issues"
1616
},
1717
"engines": {
18-
"vscode": "^1.74.0"
18+
"vscode": "^1.75.0"
1919
},
2020
"categories": [
2121
"Other"
@@ -153,7 +153,7 @@
153153
"@types/ssh2": "^0.5.52",
154154
"@types/tmp": "^0.2.1",
155155
"@types/uuid": "8.0.0",
156-
"@types/vscode": "1.74.0",
156+
"@types/vscode": "1.75.0",
157157
"@types/webpack": "^5.28.0",
158158
"@types/ws": "^8.5.4",
159159
"@types/yazl": "^2.4.2",

src/authentication/authentication.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Keychain from '../common/keychain';
99
import GitpodServer from './gitpodServer';
1010
import { arrayEquals } from '../common/utils';
1111
import { Disposable } from '../common/dispose';
12-
import { ITelemetryService, UserFlowTelemetry } from '../services/telemetryService';
12+
import { ITelemetryService, UserFlowTelemetryProperties } from '../services/telemetryService';
1313
import { INotificationService } from '../services/notificationService';
1414
import { ILogService } from '../services/logService';
1515
import { Configuration } from '../configuration';
@@ -34,7 +34,7 @@ export default class GitpodAuthenticationProvider extends Disposable implements
3434

3535
private _sessionsPromise: Promise<vscode.AuthenticationSession[]>;
3636

37-
private readonly flow = { flow: 'auth' } as Readonly<UserFlowTelemetry>;
37+
private readonly flow = { flow: 'auth' } as Readonly<UserFlowTelemetryProperties>;
3838

3939
constructor(
4040
private readonly context: vscode.ExtensionContext,

src/authentication/gitpodServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import pkceChallenge from 'pkce-challenge';
1010
import { v4 as uuid } from 'uuid';
1111
import { Disposable } from '../common/dispose';
1212
import { INotificationService } from '../services/notificationService';
13-
import { UserFlowTelemetry } from '../services/telemetryService';
13+
import { UserFlowTelemetryProperties } from '../services/telemetryService';
1414
import { ILogService } from '../services/logService';
1515

1616
interface ExchangeTokenResponse {
@@ -49,7 +49,7 @@ export default class GitpodServer extends Disposable {
4949
this._serviceUrl = serviceUrl.replace(/\/$/, '');
5050
}
5151

52-
public async login(scopes: string, flow: UserFlowTelemetry): Promise<string> {
52+
public async login(scopes: string, flow: UserFlowTelemetryProperties): Promise<string> {
5353
this.logService.info(`Logging in for the following scopes: ${scopes}`);
5454

5555
const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://gitpod.gitpod-desktop/complete-gitpod-auth`));
@@ -102,7 +102,7 @@ export default class GitpodServer extends Disposable {
102102
});
103103
}
104104

105-
private exchangeCodeForToken: (scopes: string, flow: UserFlowTelemetry) => PromiseAdapter<vscode.Uri, string> =
105+
private exchangeCodeForToken: (scopes: string, flow: UserFlowTelemetryProperties) => PromiseAdapter<vscode.Uri, string> =
106106
(scopes, flow) => async (uri, resolve, reject) => {
107107
const query = new URLSearchParams(uri.query);
108108
const code = query.get('code');

src/commands/logs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as vscode from 'vscode';
1111
import { Command } from '../commandManager';
1212
import { ILogService } from '../services/logService';
1313
import { INotificationService } from '../services/notificationService';
14-
import { ITelemetryService, UserFlowTelemetry } from '../services/telemetryService';
14+
import { ITelemetryService, UserFlowTelemetryProperties } from '../services/telemetryService';
1515
import { HostService } from '../services/hostService';
1616

1717
interface IFile {
@@ -32,7 +32,7 @@ export class ExportLogsCommand implements Command {
3232

3333
async execute() {
3434
const gitpodHost = this.hostService.gitpodHost;
35-
const flow: UserFlowTelemetry = { gitpodHost, flow: 'export_logs' };
35+
const flow: UserFlowTelemetryProperties = { gitpodHost, flow: 'export_logs' };
3636
this.telemetryService.sendUserFlowStatus('exporting', flow);
3737
try {
3838
await this.exportLogs();

0 commit comments

Comments
 (0)