Add telemetry to Spark+Synapse Pools (#392)

This commit is contained in:
Steve Faulkner 2021-01-20 11:08:29 -06:00 committed by GitHub
parent 4be53284b5
commit b3cafe3468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -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()));

View File

@ -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() &&