mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 17:23:29 -05:00
Add bindings telemetry (#18851)
* add bindings telemetry * add exitReasons
This commit is contained in:
@@ -10,10 +10,24 @@ const packageInfo = getPackageInfo()!;
|
||||
export const TelemetryReporter = new AdsTelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||
|
||||
export enum TelemetryViews {
|
||||
SqlBindingsQuickPick = 'SqlBindingsQuickPick'
|
||||
SqlBindingsQuickPick = 'SqlBindingsQuickPick',
|
||||
CreateAzureFunctionWithSqlBinding = 'CreateAzureFunctionWithSqlBinding'
|
||||
}
|
||||
|
||||
export enum TelemetryActions {
|
||||
// Create Azure Function with Sql Binding from Table
|
||||
startCreateAzureFunctionWithSqlBinding = 'startCreateAzureFunctionWithSqlBinding',
|
||||
helpCreateAzureFunctionProject = 'helpCreateAzureFunctionProject',
|
||||
learnMore = 'learnMore',
|
||||
finishCreateAzureFunctionWithSqlBinding = 'finishCreateAzureFunctionWithSqlBinding',
|
||||
exitCreateAzureFunctionQuickpick = 'exitCreateAzureFunctionQuickpick',
|
||||
|
||||
// Add SQL Binding to Azure Function
|
||||
startAddSqlBinding = 'startAddSqlBinding',
|
||||
finishAddSqlBinding = 'finishAddSqlBinding'
|
||||
getAzureFunctionProject = 'getAzureFunctionProject',
|
||||
getBindingType = 'getBindingType',
|
||||
getObjectName = 'getObjectName',
|
||||
updateConnectionString = 'updateConnectionString',
|
||||
finishAddSqlBinding = 'finishAddSqlBinding',
|
||||
exitSqlBindingsQuickpick = 'exitSqlBindingsQuickpick',
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ export interface IPackageInfo {
|
||||
aiKey: string;
|
||||
}
|
||||
|
||||
export class TimeoutError extends Error { }
|
||||
|
||||
/**
|
||||
* Consolidates on the error message string
|
||||
*/
|
||||
@@ -128,7 +130,7 @@ export function generateQuotedFullName(schema: string, objectName: string): stri
|
||||
export function timeoutPromise(errorMessage: string, ms: number = 10000): Promise<string> {
|
||||
return new Promise((_, reject) => {
|
||||
setTimeout(() => {
|
||||
reject(new Error(errorMessage));
|
||||
reject(new TimeoutError(errorMessage));
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
@@ -173,3 +175,11 @@ export function getPackageInfo(): IPackageInfo {
|
||||
aiKey: packageJson.aiKey
|
||||
};
|
||||
}
|
||||
export function getErrorType(error: any): string | undefined {
|
||||
if (error instanceof TimeoutError) {
|
||||
return 'TimeoutError';
|
||||
} else {
|
||||
return 'UnknownError';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user