From b3cafe34687fc69bf4f4851e33501776b492e659 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Wed, 20 Jan 2021 11:08:29 -0600 Subject: [PATCH] Add telemetry to Spark+Synapse Pools (#392) --- src/Explorer/Explorer.ts | 10 ++++++++++ src/Explorer/Tabs/NotebookV2Tab.ts | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/Explorer/Explorer.ts b/src/Explorer/Explorer.ts index 04e36e87d..8c7ebd2e3 100644 --- a/src/Explorer/Explorer.ts +++ b/src/Explorer/Explorer.ts @@ -88,6 +88,7 @@ import { stringToBlob } from "../Utils/BlobUtils"; import { IChoiceGroupProps } from "office-ui-fabric-react"; import { getErrorMessage, handleError, getErrorStack } from "../Common/ErrorHandlingUtils"; import { SubscriptionType } from "../Contracts/SubscriptionType"; +import { appInsights } from "../Shared/appInsights"; import { SelfServeLoadingComponentAdapter } from "../SelfServe/SelfServeLoadingComponentAdapter"; import { SelfServeType } from "../SelfServe/SelfServeUtils"; import { SelfServeComponentAdapter } from "../SelfServe/SelfServeComponentAdapter"; @@ -361,6 +362,15 @@ export default class Explorer { this.isFeatureEnabled(Constants.Features.enableSpark) ); if (this.isSparkEnabled()) { + appInsights.trackEvent( + { name: "LoadedWithSparkEnabled" }, + { + subscriptionId: userContext.subscriptionId, + accountName: userContext.databaseAccount?.name, + accountId: userContext.databaseAccount?.id, + platform: configContext.platform, + } + ); const pollArcadiaTokenRefresh = async () => { this.arcadiaToken(await this.getArcadiaToken()); setTimeout(() => pollArcadiaTokenRefresh(), this.getTokenRefreshInterval(this.arcadiaToken())); diff --git a/src/Explorer/Tabs/NotebookV2Tab.ts b/src/Explorer/Tabs/NotebookV2Tab.ts index 0bc14dde8..cb3306971 100644 --- a/src/Explorer/Tabs/NotebookV2Tab.ts +++ b/src/Explorer/Tabs/NotebookV2Tab.ts @@ -31,6 +31,8 @@ import Explorer from "../Explorer"; import { NotebookContentItem } from "../Notebook/NotebookContentItem"; import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; import { toJS, stringifyNotebook } from "@nteract/commutable"; +import { appInsights } from "../../Shared/appInsights"; +import { userContext } from "../../UserContext"; export interface NotebookTabOptions extends ViewModels.TabOptions { account: DataModels.DatabaseAccount; @@ -426,6 +428,15 @@ export default class NotebookTabV2 extends TabsBase { return; } + appInsights.trackEvent( + { name: "SparkPoolSelected" }, + { + subscriptionId: userContext.subscriptionId, + accountName: userContext.databaseAccount?.name, + accountId: userContext.databaseAccount?.id, + } + ); + this.container && this.container.arcadiaWorkspaces && this.container.arcadiaWorkspaces() &&