added missing telemetry to the Table API usage attempts (#2441)

This commit is contained in:
Tomasz Naumowicz 2024-11-20 15:33:40 +01:00 коммит произвёл GitHub
Родитель b1d47fbaed
Коммит c626b1535c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 23 добавлений и 7 удалений

Просмотреть файл

@ -3,7 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { GenericTreeItem, type AzExtTreeItem } from '@microsoft/vscode-azext-utils';
import {
callWithTelemetryAndErrorHandling,
GenericTreeItem,
type AzExtTreeItem,
type IActionContext,
} from '@microsoft/vscode-azext-utils';
import { API } from '../../AzureDBExperiences';
import { deleteCosmosDBAccount } from '../../commands/deleteDatabaseAccount/deleteCosmosDBAccount';
import { type IDeleteWizardContext } from '../../commands/deleteDatabaseAccount/IDeleteWizardContext';
import { DocDBAccountTreeItemBase } from '../../docdb/tree/DocDBAccountTreeItemBase';
@ -21,12 +27,22 @@ export class TableAccountTreeItem extends DocDBAccountTreeItemBase {
}
public async loadMoreChildrenImpl(_clearCache: boolean): Promise<AzExtTreeItem[]> {
const tableNotFoundTreeItem: AzExtTreeItem = new GenericTreeItem(this, {
contextValue: 'tableNotSupported',
label: 'Table Accounts are not supported yet.',
});
tableNotFoundTreeItem.suppressMaskLabel = true;
return [tableNotFoundTreeItem];
const result = await callWithTelemetryAndErrorHandling(
'getChildren',
(context: IActionContext): AzExtTreeItem[] => {
context.telemetry.properties.experience = API.Table;
context.telemetry.properties.parentContext = this.contextValue;
const tableNotFoundTreeItem: AzExtTreeItem = new GenericTreeItem(this, {
contextValue: 'tableNotSupported',
label: 'Table Accounts are not supported yet.',
});
tableNotFoundTreeItem.suppressMaskLabel = true;
return [tableNotFoundTreeItem];
},
);
return result ?? [];
}
public async deleteTreeItemImpl(context: IDeleteWizardContext): Promise<void> {