diff --git a/.eslintignore b/.eslintignore index 42351f99a..65d47bd0e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -275,8 +275,6 @@ src/Shared/StorageUtility.test.ts src/Shared/StorageUtility.ts src/Shared/StringUtility.test.ts src/Shared/StringUtility.ts -src/Shared/Telemetry/TelemetryConstants.ts -src/Shared/Telemetry/TelemetryProcessor.ts src/Shared/appInsights.ts src/SparkClusterManager/ArcadiaResourceManager.ts src/SparkClusterManager/SparkClusterManager.ts diff --git a/package-lock.json b/package-lock.json index aaeb70b47..fde3d86ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5392,84 +5392,90 @@ } }, "@microsoft/applicationinsights-analytics-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-analytics-js/-/applicationinsights-analytics-js-2.5.4.tgz", - "integrity": "sha512-Eda0bcThQJA/zNVzmU3+Vo9WJT/55LzUxpEATOCB6BbN1uGGUp3hGOdlV/hRl652TPutXII/gvhg8Z4uqq+VsA==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-analytics-js/-/applicationinsights-analytics-js-2.5.8.tgz", + "integrity": "sha512-2RsftiXa5ojNXuHRIC7RybWbN+Z7TMrLK2XGTza1Wq/KHRJNB48WmQuxjd6SzsNguqxRoHsH0sUogIwlK+NO8A==", "requires": { - "@microsoft/applicationinsights-common": "2.5.4", - "@microsoft/applicationinsights-core-js": "2.5.4", - "@microsoft/dynamicproto-js": "^0.5.2", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-common": "2.5.8", + "@microsoft/applicationinsights-core-js": "2.5.8", + "@microsoft/applicationinsights-shims": "1.0.1", + "@microsoft/dynamicproto-js": "^1.0.0" } }, "@microsoft/applicationinsights-channel-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-2.5.4.tgz", - "integrity": "sha512-xDgI+7LAT5xPdxbBu/fueufH/j7p+hqfPJkkyG9BYdLa77mp+UfnP1kKjthcsdrhJiVIAbx08hmZpo72espIng==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-2.5.8.tgz", + "integrity": "sha512-etVGzhNluflTikOpW9dlDxdg+B+8gt/nxmGeXqti9Hsqq0fTxcY9bmNklFIEKhOIwai4DodgJjflaDdgR0ObUQ==", "requires": { - "@microsoft/applicationinsights-common": "2.5.4", - "@microsoft/applicationinsights-core-js": "2.5.4", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-common": "2.5.8", + "@microsoft/applicationinsights-core-js": "2.5.8", + "@microsoft/applicationinsights-shims": "1.0.1", + "@microsoft/dynamicproto-js": "^1.0.0" } }, "@microsoft/applicationinsights-common": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-2.5.4.tgz", - "integrity": "sha512-lrLwBUKqK4SZq2nCegUs/O8Ew2KPtL+JUCARoo6YdT8vSiUSxVk+XvwnMOViv27+NWsM3HpqOcjMn+C3kwULZQ==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-2.5.8.tgz", + "integrity": "sha512-RIMAJTsF0H5wiRZxYIF9H8sbMe2W5Ig4yMuH0/lho69DcNZpHf8p6PSa4Qhhli0AnoWYfLE7/WlWO1eR5SkByw==", "requires": { - "@microsoft/applicationinsights-core-js": "2.5.4", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-core-js": "2.5.8", + "@microsoft/applicationinsights-shims": "1.0.1" } }, "@microsoft/applicationinsights-core-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.5.4.tgz", - "integrity": "sha512-U3spLDr99R8X7X7VH49RJhx7KhB8HZpKo7rb3ymFG6z6hB7eWQQyLyMsFnThNJI3sVqwEPCQd7dBs7viheLqjw==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.5.8.tgz", + "integrity": "sha512-NxxIViHKuqgpla+KdQk7Qy48Dm8lN4oy2mMEpv9kM5GW5MBJ8nZ4A5RV1kokF3kXuDmTUTHlWBXeLR8hauA3qQ==", "requires": { - "@microsoft/dynamicproto-js": "^0.5.2", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-shims": "1.0.1", + "@microsoft/dynamicproto-js": "^1.0.0" } }, "@microsoft/applicationinsights-dependencies-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-dependencies-js/-/applicationinsights-dependencies-js-2.5.4.tgz", - "integrity": "sha512-C01PkF7nQSYFpHiTo4Ltz5VOJqyTaQMHk2fNLBnyxLF2VhSUlfowPhyS6mGU3miscd5sQuktrlYol7LqjiRCXw==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-dependencies-js/-/applicationinsights-dependencies-js-2.5.8.tgz", + "integrity": "sha512-jnXpjE/bnlLeew78OsN8aPTLOPZQJ4y1MOO8R3E+eUXdproD2TemynSk5kUfrMdry91DZOBZnrmJ2NCB+g5ArQ==", "requires": { - "@microsoft/applicationinsights-common": "2.5.4", - "@microsoft/applicationinsights-core-js": "2.5.4", - "@microsoft/dynamicproto-js": "^0.5.2", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-common": "2.5.8", + "@microsoft/applicationinsights-core-js": "2.5.8", + "@microsoft/applicationinsights-shims": "1.0.1", + "@microsoft/dynamicproto-js": "^1.0.0" } }, "@microsoft/applicationinsights-properties-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-properties-js/-/applicationinsights-properties-js-2.5.4.tgz", - "integrity": "sha512-2ueiQYhMiNIf9Iua7zrUGIDBiO8zPLau1yBePqLvEQ2CewBE9ZrTbdqhzpBrUQUKFbmWlETXYsIWQNz+T2rRfw==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-properties-js/-/applicationinsights-properties-js-2.5.8.tgz", + "integrity": "sha512-BAOSguXe07ua6SqYmAW+8+vVvBZb4qmmUP6s5zc7kNMMgEoEGsCn2VHmM8wHHxq4J/TmYxIqwoufS+XKbUvCeQ==", "requires": { - "@microsoft/applicationinsights-common": "2.5.4", - "@microsoft/applicationinsights-core-js": "2.5.4", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-common": "2.5.8", + "@microsoft/applicationinsights-core-js": "2.5.8", + "@microsoft/applicationinsights-shims": "1.0.1" } }, + "@microsoft/applicationinsights-shims": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-1.0.1.tgz", + "integrity": "sha512-nPjUBSpvX5Dnkovp2lZzrg0/uSvYNtbAclWwVP7t8J1hy5OJ3xr3KPNaz79+b84G16Rj861ybau9Gbk7inXkTg==" + }, "@microsoft/applicationinsights-web": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web/-/applicationinsights-web-2.5.4.tgz", - "integrity": "sha512-5nBgxEDkM61E0irdi78DcEwfiLvYueyU5tQsCxovPfhbt5Ub8KzzT8cvmrh6p9Rt9DcpKP/uHD8k6OqMvdgvVg==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web/-/applicationinsights-web-2.5.8.tgz", + "integrity": "sha512-ZxCUkBJrCFNHa0LgWWbtwqu4TxJPlukuSvDrdLv6XV1yX2ETq6Q1kw/IUEtKhbtNbTZQ8aJ+x8Nc/iqbssdXTA==", "requires": { - "@microsoft/applicationinsights-analytics-js": "2.5.4", - "@microsoft/applicationinsights-channel-js": "2.5.4", - "@microsoft/applicationinsights-common": "2.5.4", - "@microsoft/applicationinsights-core-js": "2.5.4", - "@microsoft/applicationinsights-dependencies-js": "2.5.4", - "@microsoft/applicationinsights-properties-js": "2.5.4", - "@microsoft/dynamicproto-js": "^0.5.2", - "tslib": "^1.11.1" + "@microsoft/applicationinsights-analytics-js": "2.5.8", + "@microsoft/applicationinsights-channel-js": "2.5.8", + "@microsoft/applicationinsights-common": "2.5.8", + "@microsoft/applicationinsights-core-js": "2.5.8", + "@microsoft/applicationinsights-dependencies-js": "2.5.8", + "@microsoft/applicationinsights-properties-js": "2.5.8", + "@microsoft/applicationinsights-shims": "1.0.1", + "@microsoft/dynamicproto-js": "^1.0.0" } }, "@microsoft/dynamicproto-js": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-0.5.2.tgz", - "integrity": "sha512-tGwZJLtLVK96OKl5/pHeZFgi28rnKJB2DQ0V/28SVQnv9tC/OXCNOrvvvtIZM6wp1YJwqVSFnyp46w3azDjC0Q==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.0.0.tgz", + "integrity": "sha512-iHD3WsLPsuVyBCUyVFYRjxPiie2jzzn7GQibnGhTkT2HLhEJHr6COg1vkQHHGEGYU4QCTBTffIK3NCOfSzHI6Q==" }, "@microsoft/load-themed-styles": { "version": "1.10.45", diff --git a/package.json b/package.json index c4ab220f3..fcb7d1134 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@azure/cosmos-language-service": "0.0.4", "@jupyterlab/services": "4.2.0", "@jupyterlab/terminal": "1.2.1", - "@microsoft/applicationinsights-web": "2.5.4", + "@microsoft/applicationinsights-web": "2.5.8", "@nteract/commutable": "7.1.4", "@nteract/connected-components": "6.7.8", "@nteract/core": "13.0.0", diff --git a/src/Explorer/Controls/CommandButton/CommandButtonComponent.tsx b/src/Explorer/Controls/CommandButton/CommandButtonComponent.tsx index 98d4b4c0d..1560ae849 100644 --- a/src/Explorer/Controls/CommandButton/CommandButtonComponent.tsx +++ b/src/Explorer/Controls/CommandButton/CommandButtonComponent.tsx @@ -1,6 +1,6 @@ import { StringUtils } from "../../../Utils/StringUtils"; import { KeyCodes } from "../../../Common/Constants"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants"; import CollapseChevronDownIcon from "../../../../images/QueryBuilder/CollapseChevronDown_16x.png"; diff --git a/src/Explorer/Controls/GitHub/AddRepoComponent.tsx b/src/Explorer/Controls/GitHub/AddRepoComponent.tsx index 76914ef99..1352a687c 100644 --- a/src/Explorer/Controls/GitHub/AddRepoComponent.tsx +++ b/src/Explorer/Controls/GitHub/AddRepoComponent.tsx @@ -6,7 +6,7 @@ import { RepoListItem } from "./GitHubReposComponent"; import { ChildrenMargin } from "./GitHubStyleConstants"; import * as GitHubUtils from "../../../Utils/GitHubUtils"; import { IGitHubRepo } from "../../../GitHub/GitHubClient"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import UrlUtility from "../../../Common/UrlUtility"; import Explorer from "../../Explorer"; diff --git a/src/Explorer/Controls/QueriesGridReactComponent/QueriesGridComponent.tsx b/src/Explorer/Controls/QueriesGridReactComponent/QueriesGridComponent.tsx index e255d64ac..636736577 100644 --- a/src/Explorer/Controls/QueriesGridReactComponent/QueriesGridComponent.tsx +++ b/src/Explorer/Controls/QueriesGridReactComponent/QueriesGridComponent.tsx @@ -24,7 +24,7 @@ import { } from "office-ui-fabric-react/lib/utilities/selection/index"; import { StyleConstants } from "../../../Common/Constants"; import { TextField, ITextFieldProps, ITextField } from "office-ui-fabric-react/lib/TextField"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import SaveQueryBannerIcon from "../../../../images/save_query_banner.png"; import { QueriesClient } from "../../../Common/QueriesClient"; diff --git a/src/Explorer/Explorer.ts b/src/Explorer/Explorer.ts index 3b7810e79..b1fe2b451 100644 --- a/src/Explorer/Explorer.ts +++ b/src/Explorer/Explorer.ts @@ -26,7 +26,7 @@ import NewVertexPane from "./Panes/NewVertexPane"; import NotebookV2Tab, { NotebookTabOptions } from "./Tabs/NotebookV2Tab"; import Q from "q"; import ResourceTokenCollection from "./Tree/ResourceTokenCollection"; -import TelemetryProcessor from "../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../Shared/Telemetry/TelemetryProcessor"; import TerminalTab from "./Tabs/TerminalTab"; import { Action, ActionModifiers } from "../Shared/Telemetry/TelemetryConstants"; import { ActionContracts, MessageTypes } from "../Contracts/ExplorerContracts"; @@ -3117,12 +3117,6 @@ export default class Explorer { } else { loadingTitle.innerHTML = title; } - - TelemetryProcessor.trace( - Action.LoadingStatus, - ActionModifiers.Mark, - title !== "Welcome to Azure Cosmos DB" ? `Title: ${title}, Text: ${text}` : text - ); } private _openSetupNotebooksPaneForQuickstart(): void { diff --git a/src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx b/src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx index aa939ef5e..43d12dc5a 100644 --- a/src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx +++ b/src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx @@ -23,7 +23,7 @@ import { GraphConfig } from "../../Tabs/GraphTab"; import { EditorReact } from "../../Controls/Editor/EditorReact"; import LoadGraphIcon from "../../../../images/LoadGraph.png"; import { Action } from "../../../Shared/Telemetry/TelemetryConstants"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import * as Constants from "../../../Common/Constants"; import { InputProperty } from "../../../Contracts/ViewModels"; import { QueryIterator, ItemDefinition, Resource } from "@azure/cosmos"; diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts index 57042c659..f82a2937a 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts @@ -2,7 +2,7 @@ import * as ViewModels from "../../../Contracts/ViewModels"; import { PlatformType } from "../../../PlatformType"; import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants"; import { Areas } from "../../../Common/Constants"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import AddDatabaseIcon from "../../../../images/AddDatabase.svg"; import AddCollectionIcon from "../../../../images/AddCollection.svg"; diff --git a/src/Explorer/Notebook/NotebookClientV2.ts b/src/Explorer/Notebook/NotebookClientV2.ts index a8612fea9..ce1284a59 100644 --- a/src/Explorer/Notebook/NotebookClientV2.ts +++ b/src/Explorer/Notebook/NotebookClientV2.ts @@ -32,7 +32,7 @@ import { Store, AnyAction, MiddlewareAPI, Middleware, Dispatch } from "redux"; import configureStore from "./NotebookComponent/store"; import { Notification } from "react-notification-system"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; export type KernelSpecsDisplay = { name: string; displayName: string }; diff --git a/src/Explorer/Notebook/NotebookComponent/epics.ts b/src/Explorer/Notebook/NotebookComponent/epics.ts index f65677591..545b16b59 100644 --- a/src/Explorer/Notebook/NotebookComponent/epics.ts +++ b/src/Explorer/Notebook/NotebookComponent/epics.ts @@ -37,7 +37,7 @@ import * as Constants from "../../../Common/Constants"; import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils"; import { ConsoleDataType } from "../../Menus/NotificationConsole/NotificationConsoleComponent"; import * as CdbActions from "./actions"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import { Action as TelemetryAction } from "../../../Shared/Telemetry/TelemetryConstants"; import { CdbAppState } from "./types"; import { decryptJWTToken } from "../../../Utils/AuthorizationUtils"; diff --git a/src/Explorer/Notebook/NotebookComponent/reducers.ts b/src/Explorer/Notebook/NotebookComponent/reducers.ts index 0cdd4cc14..533118030 100644 --- a/src/Explorer/Notebook/NotebookComponent/reducers.ts +++ b/src/Explorer/Notebook/NotebookComponent/reducers.ts @@ -1,7 +1,7 @@ import { actions, CoreRecord, reducers as nteractReducers } from "@nteract/core"; import { Action } from "redux"; import { Areas } from "../../../Common/Constants"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import * as cdbActions from "./actions"; import { CdbRecord } from "./types"; diff --git a/src/Explorer/Notebook/NotebookManager.ts b/src/Explorer/Notebook/NotebookManager.ts index 50830ee8a..85b888d5a 100644 --- a/src/Explorer/Notebook/NotebookManager.ts +++ b/src/Explorer/Notebook/NotebookManager.ts @@ -9,7 +9,7 @@ import * as Logger from "../../Common/Logger"; import { HttpStatusCodes, Areas } from "../../Common/Constants"; import { GitHubReposPane } from "../Panes/GitHubReposPane"; import ko from "knockout"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { IContentProvider } from "@nteract/core"; import { NotebookContentProvider } from "./NotebookComponent/NotebookContentProvider"; diff --git a/src/Explorer/Panes/AddCollectionPane.ts b/src/Explorer/Panes/AddCollectionPane.ts index b3aeda75d..3f8e3f0ff 100644 --- a/src/Explorer/Panes/AddCollectionPane.ts +++ b/src/Explorer/Panes/AddCollectionPane.ts @@ -9,7 +9,7 @@ import * as PricingUtils from "../../Utils/PricingUtils"; import * as SharedConstants from "../../Shared/Constants"; import * as ViewModels from "../../Contracts/ViewModels"; import editable from "../../Common/EditableUtility"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { configContext, Platform } from "../../ConfigContext"; import { ContextualPaneBase } from "./ContextualPaneBase"; diff --git a/src/Explorer/Panes/AddDatabasePane.ts b/src/Explorer/Panes/AddDatabasePane.ts index e395a839f..e9cd4c986 100644 --- a/src/Explorer/Panes/AddDatabasePane.ts +++ b/src/Explorer/Panes/AddDatabasePane.ts @@ -7,7 +7,7 @@ import * as PricingUtils from "../../Utils/PricingUtils"; import * as SharedConstants from "../../Shared/Constants"; import * as ViewModels from "../../Contracts/ViewModels"; import editable from "../../Common/EditableUtility"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { ContextualPaneBase } from "./ContextualPaneBase"; import { createDatabase } from "../../Common/dataAccess/createDatabase"; diff --git a/src/Explorer/Panes/BrowseQueriesPane.ts b/src/Explorer/Panes/BrowseQueriesPane.ts index 7e4db0dbd..fc2b2e466 100644 --- a/src/Explorer/Panes/BrowseQueriesPane.ts +++ b/src/Explorer/Panes/BrowseQueriesPane.ts @@ -5,7 +5,7 @@ import { Areas } from "../../Common/Constants"; import { ContextualPaneBase } from "./ContextualPaneBase"; import * as Logger from "../../Common/Logger"; import { QueriesGridComponentAdapter } from "../Controls/QueriesGridReactComponent/QueriesGridComponentAdapter"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import QueryTab from "../Tabs/QueryTab"; export class BrowseQueriesPane extends ContextualPaneBase { diff --git a/src/Explorer/Panes/CassandraAddCollectionPane.ts b/src/Explorer/Panes/CassandraAddCollectionPane.ts index 66fa4af24..6198fa3f8 100644 --- a/src/Explorer/Panes/CassandraAddCollectionPane.ts +++ b/src/Explorer/Panes/CassandraAddCollectionPane.ts @@ -7,7 +7,7 @@ import * as ko from "knockout"; import * as PricingUtils from "../../Utils/PricingUtils"; import * as SharedConstants from "../../Shared/Constants"; import * as ViewModels from "../../Contracts/ViewModels"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { CassandraAPIDataClient } from "../Tables/TableDataClient"; import { ContextualPaneBase } from "./ContextualPaneBase"; diff --git a/src/Explorer/Panes/ContextualPaneBase.ts b/src/Explorer/Panes/ContextualPaneBase.ts index d63a46492..11aed8786 100644 --- a/src/Explorer/Panes/ContextualPaneBase.ts +++ b/src/Explorer/Panes/ContextualPaneBase.ts @@ -4,7 +4,7 @@ import * as Constants from "../../Common/Constants"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { KeyCodes } from "../../Common/Constants"; import { WaitsForTemplateViewModel } from "../WaitsForTemplateViewModel"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Explorer from "../Explorer"; // TODO: Use specific actions for logging telemetry data diff --git a/src/Explorer/Panes/DeleteCollectionConfirmationPane.test.ts b/src/Explorer/Panes/DeleteCollectionConfirmationPane.test.ts index abb1c41fe..fdf7fa162 100644 --- a/src/Explorer/Panes/DeleteCollectionConfirmationPane.test.ts +++ b/src/Explorer/Panes/DeleteCollectionConfirmationPane.test.ts @@ -8,7 +8,7 @@ import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstan import DeleteCollectionConfirmationPane from "./DeleteCollectionConfirmationPane"; import DeleteFeedback from "../../Common/DeleteFeedback"; import Explorer from "../Explorer"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { TreeNode } from "../../Contracts/ViewModels"; import { deleteCollection } from "../../Common/dataAccess/deleteCollection"; diff --git a/src/Explorer/Panes/DeleteCollectionConfirmationPane.ts b/src/Explorer/Panes/DeleteCollectionConfirmationPane.ts index f148ce6c6..09c9426e6 100644 --- a/src/Explorer/Panes/DeleteCollectionConfirmationPane.ts +++ b/src/Explorer/Panes/DeleteCollectionConfirmationPane.ts @@ -10,7 +10,7 @@ import { ContextualPaneBase } from "./ContextualPaneBase"; import { DefaultExperienceUtility } from "../../Shared/DefaultExperienceUtility"; import DeleteFeedback from "../../Common/DeleteFeedback"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { deleteCollection } from "../../Common/dataAccess/deleteCollection"; export default class DeleteCollectionConfirmationPane extends ContextualPaneBase { diff --git a/src/Explorer/Panes/DeleteDatabaseConfirmationPane.test.ts b/src/Explorer/Panes/DeleteDatabaseConfirmationPane.test.ts index fc8a73259..2167a5b2a 100644 --- a/src/Explorer/Panes/DeleteDatabaseConfirmationPane.test.ts +++ b/src/Explorer/Panes/DeleteDatabaseConfirmationPane.test.ts @@ -8,7 +8,7 @@ import * as ViewModels from "../../Contracts/ViewModels"; import DeleteDatabaseConfirmationPane from "./DeleteDatabaseConfirmationPane"; import DeleteFeedback from "../../Common/DeleteFeedback"; import Explorer from "../Explorer"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { TreeNode } from "../../Contracts/ViewModels"; import { TabsManager } from "../Tabs/TabsManager"; import { deleteDatabase } from "../../Common/dataAccess/deleteDatabase"; diff --git a/src/Explorer/Panes/DeleteDatabaseConfirmationPane.ts b/src/Explorer/Panes/DeleteDatabaseConfirmationPane.ts index 260061803..cfef459e4 100644 --- a/src/Explorer/Panes/DeleteDatabaseConfirmationPane.ts +++ b/src/Explorer/Panes/DeleteDatabaseConfirmationPane.ts @@ -11,7 +11,7 @@ import { DefaultExperienceUtility } from "../../Shared/DefaultExperienceUtility" import DeleteFeedback from "../../Common/DeleteFeedback"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { deleteDatabase } from "../../Common/dataAccess/deleteDatabase"; export default class DeleteDatabaseConfirmationPane extends ContextualPaneBase { diff --git a/src/Explorer/Panes/GitHubReposPane.ts b/src/Explorer/Panes/GitHubReposPane.ts index fb81e36ce..a18f7d867 100644 --- a/src/Explorer/Panes/GitHubReposPane.ts +++ b/src/Explorer/Panes/GitHubReposPane.ts @@ -5,7 +5,7 @@ import * as ViewModels from "../../Contracts/ViewModels"; import { GitHubClient, IGitHubPageInfo, IGitHubRepo } from "../../GitHub/GitHubClient"; import { IPinnedRepo, JunoClient } from "../../Juno/JunoClient"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import * as GitHubUtils from "../../Utils/GitHubUtils"; import { JunoUtils } from "../../Utils/JunoUtils"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; diff --git a/src/Explorer/Panes/SaveQueryPane.ts b/src/Explorer/Panes/SaveQueryPane.ts index 652defc5a..b5056d521 100644 --- a/src/Explorer/Panes/SaveQueryPane.ts +++ b/src/Explorer/Panes/SaveQueryPane.ts @@ -6,7 +6,7 @@ import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import { ContextualPaneBase } from "./ContextualPaneBase"; import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import QueryTab from "../Tabs/QueryTab"; export class SaveQueryPane extends ContextualPaneBase { diff --git a/src/Explorer/Panes/SetupNotebooksPane.ts b/src/Explorer/Panes/SetupNotebooksPane.ts index 1492b7529..29c84d859 100644 --- a/src/Explorer/Panes/SetupNotebooksPane.ts +++ b/src/Explorer/Panes/SetupNotebooksPane.ts @@ -4,7 +4,7 @@ import { Areas, KeyCodes } from "../../Common/Constants"; import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; import { ContextualPaneBase } from "./ContextualPaneBase"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import * as ko from "knockout"; export class SetupNotebooksPane extends ContextualPaneBase { diff --git a/src/Explorer/Panes/SwitchDirectoryPane.ts b/src/Explorer/Panes/SwitchDirectoryPane.ts index 6bef565bc..661bb6b8b 100644 --- a/src/Explorer/Panes/SwitchDirectoryPane.ts +++ b/src/Explorer/Panes/SwitchDirectoryPane.ts @@ -5,7 +5,7 @@ import { DirectoryListProps } from "../Controls/Directory/DirectoryListComponent import { DefaultDirectoryDropdownProps } from "../Controls/Directory/DefaultDirectoryDropdownComponent"; import { DirectoryComponentAdapter } from "../Controls/Directory/DirectoryComponentAdapter"; import SwitchDirectoryPaneTemplate from "./SwitchDirectoryPane.html"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; class PaneComponent { constructor(data: any) { diff --git a/src/Explorer/Tables/DataTable/DataTableViewModel.ts b/src/Explorer/Tables/DataTable/DataTableViewModel.ts index 49b2356ef..f36e6eba7 100644 --- a/src/Explorer/Tables/DataTable/DataTableViewModel.ts +++ b/src/Explorer/Tables/DataTable/DataTableViewModel.ts @@ -7,7 +7,7 @@ import * as CommonConstants from "../../../Common/Constants"; import * as Constants from "../Constants"; import * as Entities from "../Entities"; import QueryTablesTab from "../../Tabs/QueryTablesTab"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import { QueryIterator, ItemDefinition, Resource } from "@azure/cosmos"; // This is the format of the data we will have to pass to Datatable render callback, diff --git a/src/Explorer/Tables/DataTable/TableEntityListViewModel.ts b/src/Explorer/Tables/DataTable/TableEntityListViewModel.ts index bb78bea42..9bb19c1a3 100644 --- a/src/Explorer/Tables/DataTable/TableEntityListViewModel.ts +++ b/src/Explorer/Tables/DataTable/TableEntityListViewModel.ts @@ -15,7 +15,7 @@ import * as Utilities from "../Utilities"; import * as Entities from "../Entities"; import QueryTablesTab from "../../Tabs/QueryTablesTab"; import * as TableEntityProcessor from "../TableEntityProcessor"; -import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import * as ErrorParserUtility from "../../../Common/ErrorParserUtility"; import * as DataModels from "../../../Contracts/DataModels"; import * as ViewModels from "../../../Contracts/ViewModels"; diff --git a/src/Explorer/Tabs/ConflictsTab.ts b/src/Explorer/Tabs/ConflictsTab.ts index 9e6b3c556..1bd8590bb 100644 --- a/src/Explorer/Tabs/ConflictsTab.ts +++ b/src/Explorer/Tabs/ConflictsTab.ts @@ -13,7 +13,7 @@ import * as HeadersUtility from "../../Common/HeadersUtility"; import TabsBase from "./TabsBase"; import { DocumentsGridMetrics } from "../../Common/Constants"; import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import SaveIcon from "../../../images/save-cosmos.svg"; import DiscardIcon from "../../../images/discard.svg"; import DeleteIcon from "../../../images/delete.svg"; diff --git a/src/Explorer/Tabs/DatabaseSettingsTab.ts b/src/Explorer/Tabs/DatabaseSettingsTab.ts index 75915b25b..22bf74b30 100644 --- a/src/Explorer/Tabs/DatabaseSettingsTab.ts +++ b/src/Explorer/Tabs/DatabaseSettingsTab.ts @@ -11,7 +11,7 @@ import editable from "../../Common/EditableUtility"; import Q from "q"; import SaveIcon from "../../../images/save-cosmos.svg"; import TabsBase from "./TabsBase"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import { PlatformType } from "../../PlatformType"; import { RequestOptions } from "@azure/cosmos/dist-esm"; diff --git a/src/Explorer/Tabs/DocumentsTab.ts b/src/Explorer/Tabs/DocumentsTab.ts index 4b852bb3d..14e7e28b0 100644 --- a/src/Explorer/Tabs/DocumentsTab.ts +++ b/src/Explorer/Tabs/DocumentsTab.ts @@ -14,7 +14,7 @@ import TabsBase from "./TabsBase"; import { DocumentsGridMetrics } from "../../Common/Constants"; import { QueryUtils } from "../../Utils/QueryUtils"; import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import NewDocumentIcon from "../../../images/NewDocument.svg"; import SaveIcon from "../../../images/save-cosmos.svg"; import DiscardIcon from "../../../images/discard.svg"; diff --git a/src/Explorer/Tabs/MongoDocumentsTab.ts b/src/Explorer/Tabs/MongoDocumentsTab.ts index 4ca9e6cb3..491f3adf0 100644 --- a/src/Explorer/Tabs/MongoDocumentsTab.ts +++ b/src/Explorer/Tabs/MongoDocumentsTab.ts @@ -8,7 +8,7 @@ import * as ErrorParserUtility from "../../Common/ErrorParserUtility"; import MongoUtility from "../../Common/MongoUtility"; import ObjectId from "../Tree/ObjectId"; import Q from "q"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import { createDocument, diff --git a/src/Explorer/Tabs/MongoShellTab.ts b/src/Explorer/Tabs/MongoShellTab.ts index 78758d4b7..5369a0e06 100644 --- a/src/Explorer/Tabs/MongoShellTab.ts +++ b/src/Explorer/Tabs/MongoShellTab.ts @@ -6,7 +6,7 @@ import EnvironmentUtility from "../../Common/EnvironmentUtility"; import { isInvalidParentFrameOrigin } from "../../Utils/MessageValidation"; import Q from "q"; import TabsBase from "./TabsBase"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; import { HashMap } from "../../Common/HashMap"; diff --git a/src/Explorer/Tabs/NotebookV2Tab.ts b/src/Explorer/Tabs/NotebookV2Tab.ts index e369bc7be..88a692ec9 100644 --- a/src/Explorer/Tabs/NotebookV2Tab.ts +++ b/src/Explorer/Tabs/NotebookV2Tab.ts @@ -17,7 +17,7 @@ import SaveIcon from "../../../images/save-cosmos.svg"; import ClearAllOutputsIcon from "../../../images/notebook/Notebook-clear-all-outputs.svg"; import InterruptKernelIcon from "../../../images/notebook/Notebook-stop.svg"; import KillKernelIcon from "../../../images/notebook/Notebook-stop.svg"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { Areas, ArmApiVersions } from "../../Common/Constants"; import { CommandBarComponentButtonFactory } from "../Menus/CommandBar/CommandBarComponentButtonFactory"; diff --git a/src/Explorer/Tabs/QueryTab.ts b/src/Explorer/Tabs/QueryTab.ts index 6b076b45f..377dd489f 100644 --- a/src/Explorer/Tabs/QueryTab.ts +++ b/src/Explorer/Tabs/QueryTab.ts @@ -10,7 +10,7 @@ import { HashMap } from "../../Common/HashMap"; import * as HeadersUtility from "../../Common/HeadersUtility"; import * as Logger from "../../Common/Logger"; import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import ExecuteQueryIcon from "../../../images/ExecuteQuery.svg"; import { QueryUtils } from "../../Utils/QueryUtils"; import SaveQueryIcon from "../../../images/save-cosmos.svg"; diff --git a/src/Explorer/Tabs/SettingsTab.ts b/src/Explorer/Tabs/SettingsTab.ts index 844a26222..315a176fc 100644 --- a/src/Explorer/Tabs/SettingsTab.ts +++ b/src/Explorer/Tabs/SettingsTab.ts @@ -12,7 +12,7 @@ import editable from "../../Common/EditableUtility"; import Q from "q"; import SaveIcon from "../../../images/save-cosmos.svg"; import TabsBase from "./TabsBase"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import { PlatformType } from "../../PlatformType"; import { RequestOptions } from "@azure/cosmos/dist-esm"; diff --git a/src/Explorer/Tabs/StoredProcedureTab.ts b/src/Explorer/Tabs/StoredProcedureTab.ts index 46487ca63..cffeae959 100644 --- a/src/Explorer/Tabs/StoredProcedureTab.ts +++ b/src/Explorer/Tabs/StoredProcedureTab.ts @@ -7,7 +7,7 @@ import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import editable from "../../Common/EditableUtility"; import ScriptTabBase from "./ScriptTabBase"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import ExecuteQueryIcon from "../../../images/ExecuteQuery.svg"; import StoredProcedure from "../Tree/StoredProcedure"; import { createStoredProcedure, updateStoredProcedure } from "../../Common/DocumentClientUtilityBase"; diff --git a/src/Explorer/Tabs/TabsBase.ts b/src/Explorer/Tabs/TabsBase.ts index f2544883b..96b0e3c88 100644 --- a/src/Explorer/Tabs/TabsBase.ts +++ b/src/Explorer/Tabs/TabsBase.ts @@ -5,7 +5,7 @@ import * as ViewModels from "../../Contracts/ViewModels"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { RouteHandler } from "../../RouteHandlers/RouteHandler"; import { WaitsForTemplateViewModel } from "../WaitsForTemplateViewModel"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import ThemeUtility from "../../Common/ThemeUtility"; import Explorer from "../Explorer"; import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; diff --git a/src/Explorer/Tabs/TriggerTab.ts b/src/Explorer/Tabs/TriggerTab.ts index 94ec2f821..27c5e5dc7 100644 --- a/src/Explorer/Tabs/TriggerTab.ts +++ b/src/Explorer/Tabs/TriggerTab.ts @@ -5,7 +5,7 @@ import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import ScriptTabBase from "./ScriptTabBase"; import editable from "../../Common/EditableUtility"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Trigger from "../Tree/Trigger"; import { createTrigger, updateTrigger } from "../../Common/DocumentClientUtilityBase"; diff --git a/src/Explorer/Tabs/UserDefinedFunctionTab.ts b/src/Explorer/Tabs/UserDefinedFunctionTab.ts index ac8f3dd69..8507b3e93 100644 --- a/src/Explorer/Tabs/UserDefinedFunctionTab.ts +++ b/src/Explorer/Tabs/UserDefinedFunctionTab.ts @@ -4,7 +4,7 @@ import * as DataModels from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import ScriptTabBase from "./ScriptTabBase"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import UserDefinedFunction from "../Tree/UserDefinedFunction"; import { createUserDefinedFunction, updateUserDefinedFunction } from "../../Common/DocumentClientUtilityBase"; diff --git a/src/Explorer/Tree/Collection.ts b/src/Explorer/Tree/Collection.ts index f88df007b..8a0da4f69 100644 --- a/src/Explorer/Tree/Collection.ts +++ b/src/Explorer/Tree/Collection.ts @@ -9,7 +9,7 @@ import * as DataModels from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; import { PlatformType } from "../../PlatformType"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; import { OfferUtils } from "../../Utils/OfferUtils"; import { StartUploadMessageParams, UploadDetails, UploadDetailsRecord } from "../../workers/upload/definitions"; diff --git a/src/Explorer/Tree/Database.ts b/src/Explorer/Tree/Database.ts index cb007248e..a2dce06cf 100644 --- a/src/Explorer/Tree/Database.ts +++ b/src/Explorer/Tree/Database.ts @@ -7,7 +7,7 @@ import * as DataModels from "../../Contracts/DataModels"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import DatabaseSettingsTab from "../Tabs/DatabaseSettingsTab"; import Collection from "./Collection"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; import * as Logger from "../../Common/Logger"; diff --git a/src/Explorer/Tree/ResourceTokenCollection.ts b/src/Explorer/Tree/ResourceTokenCollection.ts index 7bad94a6b..3a4365449 100644 --- a/src/Explorer/Tree/ResourceTokenCollection.ts +++ b/src/Explorer/Tree/ResourceTokenCollection.ts @@ -7,7 +7,7 @@ import DocumentId from "./DocumentId"; import DocumentsTab from "../Tabs/DocumentsTab"; import Q from "q"; import QueryTab from "../Tabs/QueryTab"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Explorer from "../Explorer"; import TabsBase from "../Tabs/TabsBase"; diff --git a/src/Explorer/Tree/ResourceTreeAdapter.tsx b/src/Explorer/Tree/ResourceTreeAdapter.tsx index a16e1cc09..f47c289a1 100644 --- a/src/Explorer/Tree/ResourceTreeAdapter.tsx +++ b/src/Explorer/Tree/ResourceTreeAdapter.tsx @@ -19,7 +19,7 @@ import { ArrayHashMap } from "../../Common/ArrayHashMap"; import { NotebookUtil } from "../Notebook/NotebookUtil"; import _ from "underscore"; import { IPinnedRepo } from "../../Juno/JunoClient"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import { Areas } from "../../Common/Constants"; import * as GitHubUtils from "../../Utils/GitHubUtils"; diff --git a/src/Explorer/Tree/StoredProcedure.ts b/src/Explorer/Tree/StoredProcedure.ts index e50711c8c..3629c574f 100644 --- a/src/Explorer/Tree/StoredProcedure.ts +++ b/src/Explorer/Tree/StoredProcedure.ts @@ -5,7 +5,7 @@ import * as DataModels from "../../Contracts/DataModels"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import StoredProcedureTab from "../Tabs/StoredProcedureTab"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Explorer from "../Explorer"; import { deleteStoredProcedure, executeStoredProcedure } from "../../Common/DocumentClientUtilityBase"; import TabsBase from "../Tabs/TabsBase"; diff --git a/src/Explorer/Tree/Trigger.ts b/src/Explorer/Tree/Trigger.ts index 2c9a83004..b191f1569 100644 --- a/src/Explorer/Tree/Trigger.ts +++ b/src/Explorer/Tree/Trigger.ts @@ -4,7 +4,7 @@ import * as Constants from "../../Common/Constants"; import * as DataModels from "../../Contracts/DataModels"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import TriggerTab from "../Tabs/TriggerTab"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Explorer from "../Explorer"; import { deleteTrigger } from "../../Common/DocumentClientUtilityBase"; diff --git a/src/Explorer/Tree/UserDefinedFunction.ts b/src/Explorer/Tree/UserDefinedFunction.ts index 9f34bbc62..cf0864788 100644 --- a/src/Explorer/Tree/UserDefinedFunction.ts +++ b/src/Explorer/Tree/UserDefinedFunction.ts @@ -4,7 +4,7 @@ import * as Constants from "../../Common/Constants"; import * as DataModels from "../../Contracts/DataModels"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import UserDefinedFunctionTab from "../Tabs/UserDefinedFunctionTab"; -import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Explorer from "../Explorer"; import { deleteUserDefinedFunction } from "../../Common/DocumentClientUtilityBase"; diff --git a/src/HostedExplorer.ts b/src/HostedExplorer.ts index 76bbe691e..23c501721 100644 --- a/src/HostedExplorer.ts +++ b/src/HostedExplorer.ts @@ -29,7 +29,7 @@ import { MeControlComponentAdapter } from "./Explorer/Menus/NavBar/MeControlComp import { MessageTypes } from "./Contracts/ExplorerContracts"; import * as ReactBindingHandler from "./Bindings/ReactBindingHandler"; import { SwitchDirectoryPane, SwitchDirectoryPaneComponent } from "./Explorer/Panes/SwitchDirectoryPane"; -import TelemetryProcessor from "./Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "./Shared/Telemetry/TelemetryProcessor"; import { isInvalidParentFrameOrigin } from "./Utils/MessageValidation"; import "../less/hostedexplorer.less"; import "./Explorer/Menus/NavBar/MeControlComponent.less"; diff --git a/src/Main.ts b/src/Main.ts index 045d4cb7d..2a23cc8a1 100644 --- a/src/Main.ts +++ b/src/Main.ts @@ -60,7 +60,7 @@ import "url-polyfill/url-polyfill.min"; // import "./ReactDevTools" import * as ko from "knockout"; -import TelemetryProcessor from "./Shared/Telemetry/TelemetryProcessor"; +import * as TelemetryProcessor from "./Shared/Telemetry/TelemetryProcessor"; import * as ViewModels from "./Contracts/ViewModels"; import { Action, ActionModifiers } from "./Shared/Telemetry/TelemetryConstants"; diff --git a/src/Shared/Telemetry/TelemetryConstants.ts b/src/Shared/Telemetry/TelemetryConstants.ts index fd2f4779d..53a03cd75 100644 --- a/src/Shared/Telemetry/TelemetryConstants.ts +++ b/src/Shared/Telemetry/TelemetryConstants.ts @@ -1,13 +1,3 @@ -/** - * Defines constants related to logging telemetry. Everything except Action should be kept in sync with the one in the Portal code as much as possible. - * - * TODO: Move this to ExplorerContracts (265329) - */ -export class General { - public static ExtensionName: string = "Microsoft_Azure_DocumentDB"; - public static BladeNamePrefix: string = "Extension/Microsoft_Azure_DocumentDB/Blade/"; -} - // Data Explorer specific actions. No need to keep this in sync with the one in Portal. export enum Action { CollapseTreeNode, @@ -83,24 +73,19 @@ export enum Action { NotebooksGitHubDisconnect } -export class ActionModifiers { - public static Start: string = "start"; - public static Success: string = "success"; - public static Failed: string = "failed"; - public static Mark: string = "mark"; - public static Open: string = "open"; - public static IFrameReady: string = "iframeready"; - public static Close: string = "close"; - public static Submit: string = "submit"; - public static IndexAll: string = "index all properties"; - public static NoIndex: string = "no indexing"; - public static Cancel: string = "cancel"; -} - -export class CosmosDBEndpointNames { - public static Gateway: string = "CosmosDBGateway"; - public static ResourceProvider: string = "DocumentDBResourceProvider"; -} +export const ActionModifiers = { + Start: "start", + Success: "success", + Failed: "failed", + Mark: "mark", + Open: "open", + IFrameReady: "iframeready", + Close: "close", + Submit: "submit", + IndexAll: "index all properties", + NoIndex: "no indexing", + Cancel: "cancel" +} as const; export enum SourceBlade { AddCollection, @@ -126,17 +111,3 @@ export enum SourceBlade { ScriptExplorer, Keys } - -export class BladeLoadRequirements { - public static collections: string = "Collections"; - public static collectionsWithOffers: string = "CollectionsWithOffers"; - public static databaseAccount: string = "DatabaseAccount"; - public static keys: string = "Keys"; - public static metrics: string = "Metrics"; - public static notifications: string = "Notifications"; - public static singleCollection: string = "SingleCollection"; - - public static keysBlade: string[] = [BladeLoadRequirements.databaseAccount, BladeLoadRequirements.keys]; - public static metricsBlade: string[] = [BladeLoadRequirements.databaseAccount]; - public static overview: string[] = [BladeLoadRequirements.databaseAccount, BladeLoadRequirements.notifications]; -} diff --git a/src/Shared/Telemetry/TelemetryProcessor.ts b/src/Shared/Telemetry/TelemetryProcessor.ts index bc6910a57..950d48dd6 100644 --- a/src/Shared/Telemetry/TelemetryProcessor.ts +++ b/src/Shared/Telemetry/TelemetryProcessor.ts @@ -8,123 +8,124 @@ import { userContext } from "../../UserContext"; /** * Class that persists telemetry data to the portal tables. */ -// TODO: Move to a separate Diagnostics folder -// TODO: Log telemetry for StorageExplorer case/other clients as well -export default class TelemetryProcessor { - public static trace(action: Action, actionModifier: string = ActionModifiers.Mark, data?: any): void { - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: actionModifier, - data: JSON.stringify(data) - } - }); - appInsights.trackEvent({ name: Action[action] }, TelemetryProcessor.getData(data)); - } - - public static traceStart(action: Action, data?: any): number { - const timestamp: number = Date.now(); - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: ActionModifiers.Start, - timestamp: timestamp, - data: JSON.stringify(data) - } - }); - - appInsights.startTrackEvent(Action[action]); - return timestamp; - } - - public static traceSuccess(action: Action, data?: any, timestamp?: number): void { - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: ActionModifiers.Success, - timestamp: timestamp || Date.now(), - data: JSON.stringify(data) - } - }); - - appInsights.stopTrackEvent(Action[action], TelemetryProcessor.getData(data)); - } - - public static traceFailure(action: Action, data?: any, timestamp?: number): void { - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: ActionModifiers.Failed, - timestamp: timestamp || Date.now(), - data: JSON.stringify(data) - } - }); - - appInsights.stopTrackEvent(Action[action], TelemetryProcessor.getData(data)); - } - - public static traceCancel(action: Action, data?: any, timestamp?: number): void { - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: ActionModifiers.Cancel, - timestamp: timestamp || Date.now(), - data: JSON.stringify(data) - } - }); - - appInsights.stopTrackEvent(Action[action], TelemetryProcessor.getData(data)); - } - - public static traceOpen(action: Action, data?: any, timestamp?: number): number { - const validTimestamp = timestamp || Date.now(); - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: ActionModifiers.Open, - timestamp: validTimestamp, - data: JSON.stringify(data) - } - }); - - appInsights.startTrackEvent(Action[action]); - return validTimestamp; - } - - public static traceMark(action: Action, data?: any, timestamp?: number): number { - const validTimestamp = timestamp || Date.now(); - sendMessage({ - type: MessageTypes.TelemetryInfo, - data: { - action: Action[action], - actionModifier: ActionModifiers.Mark, - timestamp: validTimestamp, - data: JSON.stringify(data) - } - }); - - appInsights.startTrackEvent(Action[action]); - return validTimestamp; - } - - private static getData(data: any = {}): any { - if (typeof data === "string") { - data = { message: data }; +export function trace(action: Action, actionModifier: string = ActionModifiers.Mark, data?: unknown): void { + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: actionModifier, + data: JSON.stringify(data) } + }); + + appInsights.trackEvent({ name: Action[action] }, getData(data)); +} + +export function traceStart(action: Action, data?: unknown): number { + const timestamp: number = Date.now(); + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: ActionModifiers.Start, + timestamp: timestamp, + data: JSON.stringify(data) + } + }); + + appInsights.startTrackEvent(Action[action]); + return timestamp; +} + +export function traceSuccess(action: Action, data?: unknown, timestamp?: number): void { + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: ActionModifiers.Success, + timestamp: timestamp || Date.now(), + data: JSON.stringify(data) + } + }); + + appInsights.stopTrackEvent(Action[action], getData(data)); +} + +export function traceFailure(action: Action, data?: unknown, timestamp?: number): void { + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: ActionModifiers.Failed, + timestamp: timestamp || Date.now(), + data: JSON.stringify(data) + } + }); + + appInsights.stopTrackEvent(Action[action], getData(data)); +} + +export function traceCancel(action: Action, data?: unknown, timestamp?: number): void { + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: ActionModifiers.Cancel, + timestamp: timestamp || Date.now(), + data: JSON.stringify(data) + } + }); + + appInsights.stopTrackEvent(Action[action], getData(data)); +} + +export function traceOpen(action: Action, data?: unknown, timestamp?: number): number { + const validTimestamp = timestamp || Date.now(); + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: ActionModifiers.Open, + timestamp: validTimestamp, + data: JSON.stringify(data) + } + }); + + appInsights.startTrackEvent(Action[action]); + return validTimestamp; +} + +export function traceMark(action: Action, data?: unknown, timestamp?: number): number { + const validTimestamp = timestamp || Date.now(); + sendMessage({ + type: MessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: ActionModifiers.Mark, + timestamp: validTimestamp, + data: JSON.stringify(data) + } + }); + + appInsights.startTrackEvent(Action[action]); + return validTimestamp; +} + +function getData(data: unknown = {}): { [key: string]: string } | undefined { + if (typeof data === "string") { + data = { message: data }; + } + if (typeof data === "object") { return { // TODO: Need to `any` here since the window imports Explorer which can't be in strict mode yet + // eslint-disable-next-line @typescript-eslint/no-explicit-any authType: (window as any).authType, - subscriptionId: userContext.subscriptionId, + subscriptionId: userContext.subscriptionId as string, platform: configContext.platform, - env: process.env.NODE_ENV, + env: process.env.NODE_ENV as string, ...data }; } + return undefined; } diff --git a/src/Shared/appInsights.ts b/src/Shared/appInsights.ts index 11fd0acdd..3ac5fddc9 100644 --- a/src/Shared/appInsights.ts +++ b/src/Shared/appInsights.ts @@ -1,7 +1,9 @@ import { ApplicationInsights } from "@microsoft/applicationinsights-web"; + const appInsights = new ApplicationInsights({ config: { - instrumentationKey: "fa645d97-6237-4656-9559-0ee0cb55ee49" + instrumentationKey: "fa645d97-6237-4656-9559-0ee0cb55ee49", + disableFetchTracking: false } }); appInsights.loadAppInsights(); diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 055d811a2..da8886945 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -62,8 +62,6 @@ "./src/Shared/ExplorerSettings.ts", "./src/Shared/StorageUtility.ts", "./src/Shared/StringUtility.ts", - "./src/Shared/Telemetry/TelemetryConstants.ts", - "./src/Shared/Telemetry/TelemetryProcessor.ts", "./src/Shared/appInsights.ts", "./src/UserContext.ts", "./src/Utils/GitHubUtils.ts",