Skip to content

Commit

Permalink
add more telemetry logs (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrivachev authored Jun 18, 2023
1 parent 3479319 commit e925425
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 12 additions & 7 deletions server/src/dbt_execution/DbtCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export class DbtCli {
if (dbtProfileType) {
await this.suggestToInstallDbt(this.featureFinder.getPythonPath(), dbtProfileType);
} else {
this.onDbtFindFailed();
this.onDbtFindFailed(dbtProfileType);
}
} catch {
this.onDbtFindFailed();
this.onDbtFindFailed(dbtProfileType);
}
}
this.dbtReady = true;
Expand Down Expand Up @@ -107,15 +107,20 @@ export class DbtCli {
if (installResult.isOk()) {
this.notificationSender.sendRestart();
} else {
this.finishWithError(installResult.error);
this.finishWithError(installResult.error, dbtProfileType);
}
} else {
this.onDbtFindFailed();
this.onDbtFindFailed(dbtProfileType);
}
}

finishWithError(message: string): void {
finishWithError(message: string, dbtProfileType: string | undefined): void {
this.modelProgressReporter.sendFinish();
this.notificationSender.sendTelemetry('error', {
name: 'vscodeErrorMessage',
message: `${message}. Profile: ${dbtProfileType ?? 'undefined'}`,
stack: new Error('vscodeErrorMessage').stack ?? '',
});
this.connection.window.showErrorMessage(message);
}

Expand All @@ -127,7 +132,7 @@ export class DbtCli {
return this.onDbtReadyEmitter.event;
}

private onDbtFindFailed(): void {
this.finishWithError(this.getError());
private onDbtFindFailed(dbtProfileType: string | undefined): void {
this.finishWithError(this.getError(), dbtProfileType);
}
}
1 change: 0 additions & 1 deletion server/src/lsp_server/LspServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ export class LspServer extends LspServerBase<FeatureFinder> {
logStartupInfo(contextInfo: DbtProfileInfo, initTime: number, ubuntuInWslWorks: boolean): void {
this.notificationSender.sendTelemetry('log', {
dbtVersion: getStringVersion(this.featureFinder.versionInfo?.installedVersion),
pythonPath: this.featureFinder.pythonInfo.path,
pythonVersion: this.featureFinder.pythonInfo.version?.join('.') ?? 'undefined',
initTime: initTime.toString(),
type: contextInfo.type ?? 'unknown type',
Expand Down

0 comments on commit e925425

Please sign in to comment.