From ed17ee0376090445d1afa25baaa37b8660507198 Mon Sep 17 00:00:00 2001 From: Diljit Date: Thu, 15 Aug 2024 19:40:53 +0530 Subject: [PATCH] chore: ce - remove sentry performance tracker (#35710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fix the following errors ### POST https://o296332.ingest.sentry.io/api/1546547/envelope/... 429 (Too Many Requests) We have an integration with Sentry to instrument page loads and other transactions. This is no longer used. All page load metrics are collected using a new relic integration. The sentry transactions api was throwing a 429 error when we exceed our trial quota. Removing the integration should curb this error. Screenshot 2024-08-15 at 1 22 28 PM [Slack thread ](https://theappsmith.slack.com/archives/CGBPVEJ5C/p1723699775838509)for more context on our sentry sub exceeding its quota. ### TypeError: e.className.split is not a function at t.value (PageLoadInstrumentation.ts:112:33) Add a type check for string. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟒 🟒 🟒 All cypress tests have passed! πŸŽ‰ πŸŽ‰ πŸŽ‰ > Workflow run: > Commit: fc83198b613a973c9a02644fc742947a92bfbd3c > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Thu, 15 Aug 2024 08:45:49 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Removed performance tracking functionality across various components and sagas, simplifying the codebase and reducing overhead. - **Bug Fixes** - No specific bug fixes were made; improvements focus on performance tracking removal. - **Chores** - Eliminated unnecessary dependencies related to performance metrics, streamlining the application's dependency management. --- app/client/package.json | 1 - .../UITelemetry/PageLoadInstrumentation.ts | 3 +- app/client/src/ce/configs/index.ts | 14 - app/client/src/ce/configs/types.ts | 3 - .../src/ce/pages/Applications/index.tsx | 5 - app/client/src/ce/pages/Editor/routes.tsx | 17 +- app/client/src/ce/sagas/PageSagas.tsx | 53 +--- app/client/src/ce/sagas/userSagas.tsx | 12 - .../editorComponents/CloseEditor.tsx | 8 - .../CodeEditor/generateQuickCommands.tsx | 7 +- .../EntityExplorerSidebar.tsx | 7 - .../editorComponents/PropertyPaneSidebar.tsx | 8 - .../src/entities/Engine/AppEditorEngine.ts | 15 - .../src/entities/Engine/AppViewerEngine.ts | 15 - app/client/src/entities/Engine/index.ts | 2 - .../common/resizer/AutoLayoutResizable.tsx | 19 +- .../common/resizer/ModalResizable.tsx | 20 -- .../layoutSystems/common/widgetName/index.tsx | 9 - .../common/resizer/FixedLayoutResizable.tsx | 20 +- app/client/src/pages/Applications/loader.tsx | 4 - .../src/pages/Editor/APIEditor/Editor.tsx | 9 - .../src/pages/Editor/APIEditor/index.tsx | 9 - .../Editor/Explorer/Actions/ActionEntity.tsx | 6 - .../Explorer/Entity/EntityProperties.tsx | 12 - .../pages/Editor/Explorer/EntityExplorer.tsx | 7 - .../src/pages/Editor/QueryEditor/Editor.tsx | 17 +- .../src/pages/Editor/WidgetsEditor/index.tsx | 8 - app/client/src/pages/UserAuth/Login.tsx | 6 - app/client/src/pages/UserAuth/SignUp.tsx | 6 - .../src/pages/UserAuth/ThirdPartyAuth.tsx | 10 +- app/client/src/pages/setup/SignupSuccess.tsx | 4 - .../sagas/ActionExecution/PluginActionSaga.ts | 53 +--- app/client/src/sagas/ActionSagas.ts | 63 +--- app/client/src/sagas/ApiPaneSagas.ts | 7 - app/client/src/sagas/EvaluationsSaga.ts | 18 +- app/client/src/sagas/InitSagas.ts | 2 - app/client/src/utils/PerformanceTracker.ts | 281 ------------------ app/client/yarn.lock | 14 - 38 files changed, 18 insertions(+), 756 deletions(-) delete mode 100644 app/client/src/utils/PerformanceTracker.ts diff --git a/app/client/package.json b/app/client/package.json index 303289006a..7e2c57b638 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -83,7 +83,6 @@ "@opentelemetry/semantic-conventions": "1.25.1", "@react-types/shared": "^3.23.0", "@sentry/react": "^6.2.4", - "@sentry/tracing": "^6.2.4", "@shared/ast": "workspace:^", "@shared/dsl": "workspace:^", "@tanstack/virtual-core": "^3.0.0-beta.18", diff --git a/app/client/src/UITelemetry/PageLoadInstrumentation.ts b/app/client/src/UITelemetry/PageLoadInstrumentation.ts index 8d47c4972a..2fde15ab0e 100644 --- a/app/client/src/UITelemetry/PageLoadInstrumentation.ts +++ b/app/client/src/UITelemetry/PageLoadInstrumentation.ts @@ -7,6 +7,7 @@ import type { FCPMetricWithAttribution, NavigationTimingPolyfillEntry, } from "web-vitals"; +import isString from "lodash/isString"; export class PageLoadInstrumentation extends InstrumentationBase { // PerformanceObserver to observe resource timings @@ -108,7 +109,7 @@ export class PageLoadInstrumentation extends InstrumentationBase { } const elementTestId = element.getAttribute("data-testid"); - const className = element.className + const className = isString(element.className) ? "." + element.className.split(" ").join(".") : ""; const elementId = element.id ? `#${element.id}` : ""; diff --git a/app/client/src/ce/configs/index.ts b/app/client/src/ce/configs/index.ts index 07af7e758b..5191a72d97 100644 --- a/app/client/src/ce/configs/index.ts +++ b/app/client/src/ce/configs/index.ts @@ -1,7 +1,4 @@ import type { AppsmithUIConfigs } from "./types"; -import { Integrations } from "@sentry/tracing"; -import * as Sentry from "@sentry/react"; -import { createBrowserHistory } from "history"; export interface INJECTED_CONFIGS { sentry: { @@ -240,17 +237,6 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => { release: sentryRelease.value, environment: sentryENV.value, normalizeDepth: 3, - integrations: [ - typeof window === "undefined" - ? // The Browser Tracing instrumentation isn’t working (and is unnecessary) in the worker environment - undefined - : new Integrations.BrowserTracing({ - // Can also use reactRouterV4Instrumentation - routingInstrumentation: Sentry.reactRouterV5Instrumentation( - createBrowserHistory(), - ), - }), - ].filter((i) => i !== undefined), tracesSampleRate: 0.1, }, smartLook: { diff --git a/app/client/src/ce/configs/types.ts b/app/client/src/ce/configs/types.ts index 24b67ea175..4f025925d7 100644 --- a/app/client/src/ce/configs/types.ts +++ b/app/client/src/ce/configs/types.ts @@ -13,9 +13,6 @@ export interface AppsmithUIConfigs { dsn: string; release: string; environment: string; - // TODO: Fix this the next time the file is edited - // eslint-disable-next-line @typescript-eslint/no-explicit-any - integrations: any[]; normalizeDepth: number; tracesSampleRate: number; }; diff --git a/app/client/src/ce/pages/Applications/index.tsx b/app/client/src/ce/pages/Applications/index.tsx index 6f59bfb22a..6e5c770a21 100644 --- a/app/client/src/ce/pages/Applications/index.tsx +++ b/app/client/src/ce/pages/Applications/index.tsx @@ -75,9 +75,6 @@ import { useHistory, useLocation, useRouteMatch } from "react-router-dom"; import { getCurrentUser } from "selectors/usersSelectors"; import styled, { ThemeContext } from "styled-components"; import { getNextEntityName, getRandomPaletteColor } from "utils/AppsmithUtils"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { getAppsmithConfigs } from "ee/configs"; import type { Workspace } from "ee/constants/workspaceConstants"; @@ -1120,8 +1117,6 @@ export class Applications< } componentDidMount() { - PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK); - PerformanceTracker.stopTracking(PerformanceTransactionName.SIGN_UP); const urlParams = new URLSearchParams(window.location.search); const workspaceIdFromQueryParams = urlParams.get("workspaceId"); this.props.getAllWorkspaces({ diff --git a/app/client/src/ce/pages/Editor/routes.tsx b/app/client/src/ce/pages/Editor/routes.tsx index 810f1dcb45..4ad107d5a5 100644 --- a/app/client/src/ce/pages/Editor/routes.tsx +++ b/app/client/src/ce/pages/Editor/routes.tsx @@ -1,6 +1,6 @@ -import React, { useEffect } from "react"; +import React from "react"; import { Route, Switch } from "react-router-dom"; -import { useLocation, useRouteMatch } from "react-router"; +import { useRouteMatch } from "react-router"; import ApiEditor from "pages/Editor/APIEditor"; import QueryEditor from "pages/Editor/QueryEditor"; import JSEditor from "pages/Editor/JSEditor"; @@ -13,9 +13,6 @@ import { JS_COLLECTION_ID_PATH, QUERIES_EDITOR_ID_PATH, } from "constants/routes"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import * as Sentry from "@sentry/react"; import { SaaSEditorRoutes } from "pages/Editor/SaaSEditor/routes"; import OnboardingChecklist from "pages/Editor/FirstTimeUserOnboarding/Checklist"; @@ -26,16 +23,6 @@ const SentryRoute = Sentry.withSentryRouting(Route); function EditorRoutes() { const { path } = useRouteMatch(); - const { pathname } = useLocation(); - - useEffect(() => { - return () => { - PerformanceTracker.startTracking( - PerformanceTransactionName.CLOSE_SIDE_PANE, - { path: pathname }, - ); - }; - }); return ( diff --git a/app/client/src/ce/sagas/PageSagas.tsx b/app/client/src/ce/sagas/PageSagas.tsx index 4605bd9dcd..78ae498240 100644 --- a/app/client/src/ce/sagas/PageSagas.tsx +++ b/app/client/src/ce/sagas/PageSagas.tsx @@ -97,9 +97,6 @@ import type { UrlDataState } from "reducers/entityReducers/appReducer"; import { APP_MODE } from "entities/App"; import { clearEvalCache } from "../../sagas/EvaluationsSaga"; import { getQueryParams } from "utils/URLUtils"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import log from "loglevel"; import { migrateIncorrectDynamicBindingPathLists } from "utils/migrations/IncorrectDynamicBindingPathLists"; import * as Sentry from "@sentry/react"; @@ -298,10 +295,6 @@ export function* fetchPageSaga(action: ReduxAction) { isFirstLoad = false, pageWithMigratedDsl, } = action.payload; - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_API, - { pageId }, - ); const params: FetchPageRequest = { pageId, migrateDSL: true }; const fetchPageResponse: FetchPageResponse = yield call( @@ -315,18 +308,8 @@ export function* fetchPageSaga(action: ReduxAction) { pageId, isFirstLoad, }); - - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_API, - ); } catch (error) { log.error(error); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_API, - { - failed: true, - }, - ); yield put({ type: ReduxActionErrorTypes.FETCH_PAGE_ERROR, payload: { @@ -342,13 +325,7 @@ export function* fetchPublishedPageSaga( try { const { bustCache, firstLoad, pageId, pageWithMigratedDsl } = action.payload; - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_API, - { - pageId: pageId, - published: true, - }, - ); + const params = { pageId, bustCache }; const response: FetchPageResponse = yield call( getFromServerWhenNoPrefetchedResult, @@ -392,18 +369,8 @@ export function* fetchPublishedPageSaga( if (!firstLoad) { yield put(fetchAllPageEntityCompletion([executePageLoadActions()])); } - - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_API, - ); } } catch (error) { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_API, - { - failed: true, - }, - ); yield put({ type: ReduxActionErrorTypes.FETCH_PUBLISHED_PAGE_ERROR, payload: { @@ -447,12 +414,7 @@ export function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) { widgets, editorConfigs, ); - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.SAVE_PAGE_API, - { - pageId: savePageRequest.pageId, - }, - ); + try { // Store the updated DSL in the pageDSLs reducer yield put({ @@ -512,22 +474,13 @@ export function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) { } yield put(setLastUpdatedTime(Date.now() / 1000)); yield put(savePageSuccess(savePageResponse)); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.SAVE_PAGE_API, - ); + checkAndLogErrorsIfCyclicDependency( (savePageResponse.data as SavePageResponseData) .layoutOnLoadActionErrors, ); } } catch (error) { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.SAVE_PAGE_API, - { - failed: true, - }, - ); - if (error instanceof UserCancelledActionExecutionError) { return; } diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx index 731ad0f4e7..86eddf1d04 100644 --- a/app/client/src/ce/sagas/userSagas.tsx +++ b/app/client/src/ce/sagas/userSagas.tsx @@ -42,9 +42,6 @@ import { } from "actions/userActions"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import { INVITE_USERS_TO_WORKSPACE_FORM } from "ee/constants/forms"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import type { User } from "constants/userConstants"; import { ANONYMOUS_USERNAME } from "constants/userConstants"; import { @@ -154,9 +151,6 @@ export function* getCurrentUserSaga(action?: { }) { const userProfile = action?.payload?.userProfile; try { - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.USER_ME_API, - ); const response: ApiResponse = yield call( getFromServerWhenNoPrefetchedResult, userProfile, @@ -172,10 +166,6 @@ export function* getCurrentUserSaga(action?: { }); } } catch (error) { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.USER_ME_API, - { failed: true }, - ); yield put({ type: ReduxActionErrorTypes.FETCH_USER_DETAILS_ERROR, payload: { @@ -237,8 +227,6 @@ export function* runUserSideEffectsSaga() { if (currentUser.emptyInstance) { history.replace(SETUP); } - - PerformanceTracker.stopAsyncTracking(PerformanceTransactionName.USER_ME_API); } export function* forgotPasswordSaga( diff --git a/app/client/src/components/editorComponents/CloseEditor.tsx b/app/client/src/components/editorComponents/CloseEditor.tsx index e57f9083ff..2e420c839b 100644 --- a/app/client/src/components/editorComponents/CloseEditor.tsx +++ b/app/client/src/components/editorComponents/CloseEditor.tsx @@ -1,7 +1,4 @@ import React from "react"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { INTEGRATION_TABS } from "constants/routes"; import { getQueryParams } from "utils/URLUtils"; import { getIsGeneratePageInitiator } from "utils/GenerateCrudUtil"; @@ -42,11 +39,6 @@ function CloseEditor() { } const handleClose = () => { - PerformanceTracker.startTracking( - PerformanceTransactionName.CLOSE_SIDE_PANE, - { path: location.pathname }, - ); - // if it is a generate CRUD page flow from which user came here // then route user back to `/generate-page/form` // else go back to BUILDER_PAGE diff --git a/app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx b/app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx index 1903c4ac4e..2c5ce77ca0 100644 --- a/app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx +++ b/app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx @@ -17,9 +17,6 @@ import BetaCard from "../BetaCard"; import type { NavigationData } from "selectors/navigationSelectors"; import type { AIEditorContext } from "ee/components/editorComponents/GPT"; import type { EntityTypeValue } from "ee/entities/DataTree/types"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import history, { NavigationMethod } from "utils/history"; import type { Plugin } from "api/PluginApi"; import { EDIT, createMessage } from "ee/constants/messages"; @@ -224,9 +221,7 @@ export function Command(props: { (event) => { event.stopPropagation(); if (!props.url) return; - PerformanceTracker.startTracking(PerformanceTransactionName.OPEN_ACTION, { - url: props.url, - }); + history.push(props.url, { invokedBy: NavigationMethod.SlashCommandHint }); AnalyticsUtil.logEvent("EDIT_ACTION_CLICK", props.eventParams || {}); }, diff --git a/app/client/src/components/editorComponents/EntityExplorerSidebar.tsx b/app/client/src/components/editorComponents/EntityExplorerSidebar.tsx index 915651e99c..b3f5678435 100644 --- a/app/client/src/components/editorComponents/EntityExplorerSidebar.tsx +++ b/app/client/src/components/editorComponents/EntityExplorerSidebar.tsx @@ -10,9 +10,6 @@ import React, { } from "react"; import { useDispatch, useSelector } from "react-redux"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { updateExplorerWidthAction } from "actions/explorerActions"; import { getExplorerActive, @@ -73,10 +70,6 @@ export const EntityExplorerSidebar = memo(({ children }: Props) => { const resizer = useHorizontalResize(sidebarRef, onWidthChange, onDragEnd); const [tooltipIsOpen, setTooltipIsOpen] = useState(false); - PerformanceTracker.startTracking(PerformanceTransactionName.SIDE_BAR_MOUNT); - useEffect(() => { - PerformanceTracker.stopTracking(); - }); /** * on hover of resizer, show tooltip diff --git a/app/client/src/components/editorComponents/PropertyPaneSidebar.tsx b/app/client/src/components/editorComponents/PropertyPaneSidebar.tsx index 0ef2fa22f8..0e7e00aa4e 100644 --- a/app/client/src/components/editorComponents/PropertyPaneSidebar.tsx +++ b/app/client/src/components/editorComponents/PropertyPaneSidebar.tsx @@ -3,9 +3,6 @@ import * as Sentry from "@sentry/react"; import { useSelector } from "react-redux"; import React, { memo, useContext, useEffect, useMemo, useRef } from "react"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { getSelectedWidgets } from "selectors/ui"; import { tailwindLayers } from "constants/Layers"; import WidgetPropertyPane from "pages/Editor/PropertyPane"; @@ -75,11 +72,6 @@ export const PropertyPaneSidebar = memo((props: Props) => { prevSelectedWidgetId.current = selectedWidgetIds.length === 1 ? selectedWidgetIds[0] : undefined; - PerformanceTracker.startTracking(PerformanceTransactionName.SIDE_BAR_MOUNT); - useEffect(() => { - PerformanceTracker.stopTracking(); - }); - /** * renders the property pane: * 2. if no widget is selected -> CanvasPropertyPane diff --git a/app/client/src/entities/Engine/AppEditorEngine.ts b/app/client/src/entities/Engine/AppEditorEngine.ts index b4b7c6c68f..ab77ec903a 100644 --- a/app/client/src/entities/Engine/AppEditorEngine.ts +++ b/app/client/src/entities/Engine/AppEditorEngine.ts @@ -36,9 +36,6 @@ import { import { getCurrentGitBranch } from "selectors/gitSyncSelectors"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import history from "utils/history"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import type { AppEnginePayload } from "."; import AppEngine, { ActionsNotFoundError, @@ -107,18 +104,6 @@ export default class AppEditorEngine extends AppEngine { endSpan(editorSetupSpan); } - public startPerformanceTracking() { - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.INIT_EDIT_APP, - ); - } - - public stopPerformanceTracking() { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.INIT_EDIT_APP, - ); - } - private *loadPageThemesAndActions( toLoadPageId: string, applicationId: string, diff --git a/app/client/src/entities/Engine/AppViewerEngine.ts b/app/client/src/entities/Engine/AppViewerEngine.ts index 4214c4bb1d..cbef659957 100644 --- a/app/client/src/entities/Engine/AppViewerEngine.ts +++ b/app/client/src/entities/Engine/AppViewerEngine.ts @@ -18,9 +18,6 @@ import { reportSWStatus, waitForWidgetConfigBuild, } from "sagas/InitSagas"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import type { AppEnginePayload } from "."; import AppEngine, { ActionsNotFoundError } from "."; import { fetchJSLibraries } from "actions/JSLibraryActions"; @@ -77,18 +74,6 @@ export default class AppViewerEngine extends AppEngine { endSpan(viewerSetupSpan); } - startPerformanceTracking() { - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.INIT_VIEW_APP, - ); - } - - stopPerformanceTracking() { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.INIT_VIEW_APP, - ); - } - *loadAppEntities( toLoadPageId: string, applicationId: string, diff --git a/app/client/src/entities/Engine/index.ts b/app/client/src/entities/Engine/index.ts index 33c5e1ed19..1239baddd4 100644 --- a/app/client/src/entities/Engine/index.ts +++ b/app/client/src/entities/Engine/index.ts @@ -78,8 +78,6 @@ export default abstract class AppEngine { rootSpan: Span, ): any; abstract loadGit(applicationId: string, rootSpan: Span): any; - abstract startPerformanceTracking(): any; - abstract stopPerformanceTracking(): any; abstract completeChore(rootSpan: Span): any; /* eslint-enable @typescript-eslint/no-explicit-any */ diff --git a/app/client/src/layoutSystems/autolayout/common/resizer/AutoLayoutResizable.tsx b/app/client/src/layoutSystems/autolayout/common/resizer/AutoLayoutResizable.tsx index ad29e9cced..3fdc49b49a 100644 --- a/app/client/src/layoutSystems/autolayout/common/resizer/AutoLayoutResizable.tsx +++ b/app/client/src/layoutSystems/autolayout/common/resizer/AutoLayoutResizable.tsx @@ -40,9 +40,6 @@ import { ResponsiveBehavior, } from "layoutSystems/common/utils/constants"; import { useReflow } from "utils/hooks/useReflow"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import WidgetFactory from "WidgetProvider/factory"; import { isDropZoneOccupied } from "utils/WidgetPropsUtils"; import { isFunction } from "lodash"; @@ -92,16 +89,7 @@ function AutoLayoutResizableComponent(props: ResizableProps) { occupiedSpacesBySiblingWidgets, ); }; - // Performance tracking start - const sentryPerfTags = props.zWidgetType - ? [{ name: "widget_type", value: props.zWidgetType }] - : []; - PerformanceTracker.startTracking( - PerformanceTransactionName.SHOW_RESIZE_HANDLES, - { widgetId: props.zWidgetId }, - true, - sentryPerfTags, - ); + const reflowSelector = getReflowSelector(props.widgetId); const equal = ( @@ -126,11 +114,6 @@ function AutoLayoutResizableComponent(props: ResizableProps) { false, ); - useEffect(() => { - PerformanceTracker.stopTracking( - PerformanceTransactionName.SHOW_RESIZE_HANDLES, - ); - }, []); //end const [pointerEvents, togglePointerEvents] = useState(true); const [newDimensions, set] = useState({ diff --git a/app/client/src/layoutSystems/common/resizer/ModalResizable.tsx b/app/client/src/layoutSystems/common/resizer/ModalResizable.tsx index 4d71475d31..d671e5f356 100644 --- a/app/client/src/layoutSystems/common/resizer/ModalResizable.tsx +++ b/app/client/src/layoutSystems/common/resizer/ModalResizable.tsx @@ -9,9 +9,6 @@ import { ResizeWrapper, } from "layoutSystems/common/resizer/common"; import type { StyledComponent } from "styled-components"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; const getSnappedValues = ( x: number, @@ -103,23 +100,6 @@ interface ResizableProps { } export function ModalResizable(props: ResizableProps) { - // Performance tracking start - const sentryPerfTags = props.zWidgetType - ? [{ name: "widget_type", value: props.zWidgetType }] - : []; - PerformanceTracker.startTracking( - PerformanceTransactionName.SHOW_RESIZE_HANDLES, - { widgetId: props.widgetId }, - true, - sentryPerfTags, - ); - - useEffect(() => { - PerformanceTracker.stopTracking( - PerformanceTransactionName.SHOW_RESIZE_HANDLES, - ); - }); - //end const [pointerEvents, togglePointerEvents] = useState(true); const [newDimensions, set] = useState({ width: props.componentWidth, diff --git a/app/client/src/layoutSystems/common/widgetName/index.tsx b/app/client/src/layoutSystems/common/widgetName/index.tsx index 1b98b032eb..fc45dd4520 100644 --- a/app/client/src/layoutSystems/common/widgetName/index.tsx +++ b/app/client/src/layoutSystems/common/widgetName/index.tsx @@ -15,9 +15,6 @@ import { import { getIsTableFilterPaneVisible } from "selectors/tableFilterSelectors"; import styled from "styled-components"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import WidgetFactory from "WidgetProvider/factory"; import { useShowTableFilterPane } from "utils/hooks/dragResizeHooks"; import { useWidgetSelection } from "utils/hooks/useWidgetSelection"; @@ -113,12 +110,6 @@ export function WidgetNameComponent(props: WidgetNameComponentProps) { }), ); } else if (!isActiveInPropertyPane) { - PerformanceTracker.startTracking( - PerformanceTransactionName.OPEN_PROPERTY_PANE, - { widgetId: props.widgetId }, - true, - [{ name: "widget_type", value: props.type }], - ); AnalyticsUtil.logEvent("PROPERTY_PANE_OPEN_CLICK", { widgetType: props.type, widgetId: props.widgetId, diff --git a/app/client/src/layoutSystems/fixedlayout/common/resizer/FixedLayoutResizable.tsx b/app/client/src/layoutSystems/fixedlayout/common/resizer/FixedLayoutResizable.tsx index 9cfd40ec07..d83636ce21 100644 --- a/app/client/src/layoutSystems/fixedlayout/common/resizer/FixedLayoutResizable.tsx +++ b/app/client/src/layoutSystems/fixedlayout/common/resizer/FixedLayoutResizable.tsx @@ -20,9 +20,6 @@ import { getWidgetByID } from "sagas/selectors"; import { ReflowDirection } from "reflow/reflowTypes"; import { getContainerOccupiedSpacesSelectorWhileResizing } from "selectors/editorSelectors"; import { getReflowSelector } from "selectors/widgetReflowSelectors"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { isDropZoneOccupied } from "utils/WidgetPropsUtils"; import { useReflow } from "utils/hooks/useReflow"; @@ -44,16 +41,7 @@ export function FixedLayoutResizable(props: ResizableProps) { occupiedSpacesBySiblingWidgets, ); }; - // Performance tracking start - const sentryPerfTags = props.zWidgetType - ? [{ name: "widget_type", value: props.zWidgetType }] - : []; - PerformanceTracker.startTracking( - PerformanceTransactionName.SHOW_RESIZE_HANDLES, - { widgetId: props.zWidgetId }, - true, - sentryPerfTags, - ); + const reflowSelector = getReflowSelector(props.widgetId); const equal = ( @@ -78,12 +66,6 @@ export function FixedLayoutResizable(props: ResizableProps) { ); const widget = useSelector(getWidgetByID(props.widgetId)); - useEffect(() => { - PerformanceTracker.stopTracking( - PerformanceTransactionName.SHOW_RESIZE_HANDLES, - ); - }, []); - //end const [pointerEvents, togglePointerEvents] = useState(true); const dimensionReflectionProps = { reflectDimension: true, diff --git a/app/client/src/pages/Applications/loader.tsx b/app/client/src/pages/Applications/loader.tsx index 0678801673..02a7cb5790 100644 --- a/app/client/src/pages/Applications/loader.tsx +++ b/app/client/src/pages/Applications/loader.tsx @@ -1,9 +1,6 @@ import React from "react"; import PageLoadingBar from "pages/common/PageLoadingBar"; import { retryPromise } from "utils/AppsmithUtils"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import { connect } from "react-redux"; import { showDebugger } from "actions/debuggerActions"; @@ -25,7 +22,6 @@ class ApplicationListLoader extends React.PureComponent { //Close debugger call is required because if we import the application page with debugger open //it will cause a debugger to open. issue #21xxx this.props.closeDebugger(); - PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK); AnalyticsUtil.logEvent("APPLICATIONS_PAGE_LOAD"); retryPromise( async () => diff --git a/app/client/src/pages/Editor/APIEditor/Editor.tsx b/app/client/src/pages/Editor/APIEditor/Editor.tsx index efd808ef77..3da40cb634 100644 --- a/app/client/src/pages/Editor/APIEditor/Editor.tsx +++ b/app/client/src/pages/Editor/APIEditor/Editor.tsx @@ -22,9 +22,6 @@ import type { CSSProperties } from "styled-components"; import styled from "styled-components"; import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper"; import { changeApi } from "actions/apiPaneActions"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import * as Sentry from "@sentry/react"; import EntityNotFoundPane from "pages/Editor/EntityNotFoundPane"; import type { ApplicationPayload } from "ee/constants/ReduxActionConstants"; @@ -88,9 +85,6 @@ class ApiEditor extends React.Component { context!: React.ContextType; componentDidMount() { - PerformanceTracker.stopTracking(PerformanceTransactionName.OPEN_ACTION, { - actionType: "API", - }); const type = this.getFormName(); if (this.props.apiId) { this.props.changeAPIPage(this.props.apiId, type === "SAAS"); @@ -109,9 +103,6 @@ class ApiEditor extends React.Component { }; componentDidUpdate(prevProps: Props) { - if (prevProps.isRunning && !this.props.isRunning) { - PerformanceTracker.stopTracking(PerformanceTransactionName.RUN_API_CLICK); - } if (prevProps.apiId !== this.props.apiId) { const type = this.getFormName(); this.props.changeAPIPage(this.props.apiId || "", type === "SAAS"); diff --git a/app/client/src/pages/Editor/APIEditor/index.tsx b/app/client/src/pages/Editor/APIEditor/index.tsx index 9288eef2ef..d7affd3e55 100644 --- a/app/client/src/pages/Editor/APIEditor/index.tsx +++ b/app/client/src/pages/Editor/APIEditor/index.tsx @@ -29,9 +29,6 @@ import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { ApiEditorContextProvider } from "./ApiEditorContext"; import type { PaginationField } from "api/ActionAPI"; import { get, keyBy } from "lodash"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import ConvertToModuleInstanceCTA from "ee/pages/Editor/EntityEditor/ConvertToModuleInstanceCTA"; import { MODULE_TYPE } from "ee/constants/ModuleConstants"; import Disabler from "pages/common/Disabler"; @@ -140,12 +137,6 @@ function ApiEditorWrapper(props: ApiEditorWrapperProps) { const handleRunClick = useCallback( (paginationField?: PaginationField) => { const pluginName = plugins.find((plugin) => plugin.id === pluginId)?.name; - PerformanceTracker.startTracking( - PerformanceTransactionName.RUN_API_CLICK, - { - apiId: action?.id, - }, - ); AnalyticsUtil.logEvent("RUN_API_CLICK", { apiName, apiID: action?.id, diff --git a/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx b/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx index 8387eb879a..661b3c5b97 100644 --- a/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx +++ b/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx @@ -3,9 +3,6 @@ import { useSelector } from "react-redux"; import Entity, { EntityClassNames } from "../Entity"; import ActionEntityContextMenu from "./ActionEntityContextMenu"; import history, { NavigationMethod } from "utils/history"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { getActionByBaseId, getDatasource, @@ -70,9 +67,6 @@ export const ExplorerActionEntity = memo((props: ExplorerActionEntityProps) => { const icon = config?.getIcon(action, pluginGroups[action.pluginId]); const switchToAction = useCallback(() => { - PerformanceTracker.startTracking(PerformanceTransactionName.OPEN_ACTION, { - url, - }); url && history.push(url, { invokedBy: NavigationMethod.EntityExplorer }); AnalyticsUtil.logEvent("ENTITY_EXPLORER_CLICK", { type: "QUERIES/APIs", diff --git a/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx b/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx index ddcf9f733c..228470a69d 100644 --- a/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx +++ b/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx @@ -2,9 +2,6 @@ import React, { useCallback, useEffect } from "react"; import EntityProperty from "./EntityProperty"; import { useDispatch, useSelector } from "react-redux"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import * as Sentry from "@sentry/react"; import type { AppState } from "ee/reducers"; import classNames from "classnames"; @@ -50,15 +47,6 @@ export function EntityProperties() { (state: AppState) => state.ui.widgetDragResize.lastSelectedWidget, ); - PerformanceTracker.startTracking( - PerformanceTransactionName.ENTITY_EXPLORER_ENTITY, - ); - useEffect(() => { - PerformanceTracker.stopTracking( - PerformanceTransactionName.ENTITY_EXPLORER_ENTITY, - ); - }); - useEffect(() => { document.addEventListener("click", handleOutsideClick); return () => document.removeEventListener("click", handleOutsideClick); diff --git a/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx b/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx index ce187fcdc4..11feb000b4 100644 --- a/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx +++ b/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx @@ -1,9 +1,6 @@ import React, { useRef, useCallback, useEffect } from "react"; import styled from "styled-components"; import { NonIdealState, Classes } from "@blueprintjs/core"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { useDispatch, useSelector } from "react-redux"; import { Colors } from "constants/Colors"; @@ -66,10 +63,6 @@ const NoResult = styled(NonIdealState)` function EntityExplorer({ isActive }: { isActive: boolean }) { const dispatch = useDispatch(); - PerformanceTracker.startTracking(PerformanceTransactionName.ENTITY_EXPLORER); - useEffect(() => { - PerformanceTracker.stopTracking(); - }); const explorerRef = useRef(null); const isFirstTimeUserOnboardingEnabled = useSelector( getIsFirstTimeUserOnboardingEnabled, diff --git a/app/client/src/pages/Editor/QueryEditor/Editor.tsx b/app/client/src/pages/Editor/QueryEditor/Editor.tsx index 8670184f34..0d940cd1ec 100644 --- a/app/client/src/pages/Editor/QueryEditor/Editor.tsx +++ b/app/client/src/pages/Editor/QueryEditor/Editor.tsx @@ -30,9 +30,6 @@ import { PLUGIN_PACKAGE_DBS } from "constants/QueryEditorConstants"; import type { QueryAction, SaaSAction } from "entities/Action"; import Spinner from "components/editorComponents/Spinner"; import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import { initFormEvaluations } from "actions/evaluationActions"; import { getUIComponent } from "./helpers"; @@ -149,10 +146,6 @@ class QueryEditor extends React.Component { this.props.setActionProperty(this.props.actionId, path, value); } } - - PerformanceTracker.stopTracking(PerformanceTransactionName.OPEN_ACTION, { - actionType: "QUERY", - }); } handleDeleteClick = () => { @@ -169,10 +162,7 @@ class QueryEditor extends React.Component { const pluginName = this.props.plugins.find( (plugin) => plugin.id === this.props.pluginId, )?.name; - PerformanceTracker.startTracking( - PerformanceTransactionName.RUN_QUERY_CLICK, - { actionId: this.props.actionId }, - ); + AnalyticsUtil.logEvent("RUN_QUERY_CLICK", { actionId: this.props.actionId, dataSourceSize: dataSources.length, @@ -186,11 +176,6 @@ class QueryEditor extends React.Component { }; componentDidUpdate(prevProps: Props) { - if (prevProps.isRunning === true && this.props.isRunning === false) { - PerformanceTracker.stopTracking( - PerformanceTransactionName.RUN_QUERY_CLICK, - ); - } // Update the page when the queryID is changed by changing the // URL or selecting new query from the query pane // reusing same logic for changing query panes for switching query editor datasources, since the operations are similar. diff --git a/app/client/src/pages/Editor/WidgetsEditor/index.tsx b/app/client/src/pages/Editor/WidgetsEditor/index.tsx index fc425ae79a..2260c98ec3 100644 --- a/app/client/src/pages/Editor/WidgetsEditor/index.tsx +++ b/app/client/src/pages/Editor/WidgetsEditor/index.tsx @@ -6,9 +6,6 @@ import { getCurrentPageName, } from "selectors/editorSelectors"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { getCurrentApplication } from "ee/selectors/applicationSelectors"; import { WidgetEditorContainer } from "./WidgetEditorContainer"; import { WidgetEditorHeader } from "./WidgetEditorHeader"; @@ -27,10 +24,6 @@ function WidgetsEditor() { const currentPageName = useSelector(getCurrentPageName); const currentApp = useSelector(getCurrentApplication); - useEffect(() => { - PerformanceTracker.stopTracking(PerformanceTransactionName.CLOSE_SIDE_PANE); - }); - useEffect(() => { if (currentPageName !== undefined && currentPageId !== undefined) { // Logging page load event @@ -43,7 +36,6 @@ function WidgetsEditor() { } }, [currentPageName, currentPageId]); - PerformanceTracker.stopTracking(); return ( diff --git a/app/client/src/pages/UserAuth/Login.tsx b/app/client/src/pages/UserAuth/Login.tsx index 9f5b774cb9..79545eb6af 100644 --- a/app/client/src/pages/UserAuth/Login.tsx +++ b/app/client/src/pages/UserAuth/Login.tsx @@ -39,9 +39,6 @@ import { } from "pages/UserAuth/StyledComponents"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import { LOGIN_SUBMIT_PATH } from "ee/constants/ApiConstants"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { getIsSafeRedirectURL } from "utils/helpers"; import { getCurrentUser } from "selectors/usersSelectors"; import Container from "pages/UserAuth/Container"; @@ -201,9 +198,6 @@ export function Login(props: LoginFormProps) { isDisabled={!isFormValid} kind="primary" onClick={() => { - PerformanceTracker.startTracking( - PerformanceTransactionName.LOGIN_CLICK, - ); AnalyticsUtil.logEvent("LOGIN_CLICK", { loginMethod: "EMAIL", }); diff --git a/app/client/src/pages/UserAuth/SignUp.tsx b/app/client/src/pages/UserAuth/SignUp.tsx index 1fc06c51de..94cb2c6771 100644 --- a/app/client/src/pages/UserAuth/SignUp.tsx +++ b/app/client/src/pages/UserAuth/SignUp.tsx @@ -39,9 +39,6 @@ import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import { SIGNUP_SUBMIT_PATH } from "ee/constants/ApiConstants"; import { connect, useSelector } from "react-redux"; import type { AppState } from "ee/reducers"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { SIGNUP_FORM_EMAIL_FIELD_NAME } from "ee/constants/forms"; import { getAppsmithConfigs } from "ee/configs"; @@ -261,9 +258,6 @@ export function SignUp(props: SignUpFormProps) { AnalyticsUtil.logEvent("SIGNUP_CLICK", { signupMethod: "EMAIL", }); - PerformanceTracker.startTracking( - PerformanceTransactionName.SIGN_UP, - ); }} size="md" type="submit" diff --git a/app/client/src/pages/UserAuth/ThirdPartyAuth.tsx b/app/client/src/pages/UserAuth/ThirdPartyAuth.tsx index 41580ece9f..51fe4bf0fe 100644 --- a/app/client/src/pages/UserAuth/ThirdPartyAuth.tsx +++ b/app/client/src/pages/UserAuth/ThirdPartyAuth.tsx @@ -5,9 +5,6 @@ import { getSocialLoginButtonProps } from "ee/utils/signupHelpers"; import type { EventName } from "ee/utils/analyticsUtilTypes"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import { useLocation } from "react-router-dom"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { Button } from "@appsmith/ads"; import { isTenantConfig } from "ee/utils/adminSettingsHelpers"; import { useSelector } from "react-redux"; @@ -63,12 +60,7 @@ function SocialLoginButton(props: { if (props.type === "SIGNUP") { eventName = "SIGNUP_CLICK"; } - PerformanceTracker.startTracking( - eventName === "SIGNUP_CLICK" - ? PerformanceTransactionName.SIGN_UP - : PerformanceTransactionName.LOGIN_CLICK, - { name: props.name.toUpperCase() }, - ); + AnalyticsUtil.logEvent(eventName, { loginMethod: props.name.toUpperCase(), }); diff --git a/app/client/src/pages/setup/SignupSuccess.tsx b/app/client/src/pages/setup/SignupSuccess.tsx index fae14f5e6d..bfc5d14e0f 100644 --- a/app/client/src/pages/setup/SignupSuccess.tsx +++ b/app/client/src/pages/setup/SignupSuccess.tsx @@ -5,9 +5,6 @@ import { useCallback } from "react"; import { useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; import { getCurrentUser } from "selectors/usersSelectors"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import UserWelcomeScreen from "pages/setup/UserWelcomeScreen"; import { Center } from "pages/setup/common"; import { Spinner } from "@appsmith/ads"; @@ -27,7 +24,6 @@ export function SignupSuccess() { const user = useSelector(getCurrentUser); useEffect(() => { - PerformanceTracker.stopTracking(PerformanceTransactionName.SIGN_UP); user?.email && setUserSignedUpFlag(user?.email); }, []); diff --git a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts index ce2181f293..6e48b2d56c 100644 --- a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts +++ b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts @@ -72,7 +72,6 @@ import { extractClientDefinedErrorMetadata, validateResponse, } from "sagas/ErrorSagas"; -import type { EventName } from "ee/utils/analyticsUtilTypes"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import type { Action } from "entities/Action"; import { ActionExecutionContext } from "entities/Action"; @@ -103,9 +102,6 @@ import { getLayoutOnLoadActions, getLayoutOnLoadIssues, } from "selectors/editorSelectors"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import * as log from "loglevel"; import { EMPTY_RESPONSE } from "components/editorComponents/emptyResponse"; import type { AppState } from "ee/reducers"; @@ -536,13 +532,6 @@ export default function* executePluginActionTriggerSaga( getType(params), ); } - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.EXECUTE_ACTION, - { - actionId: actionId, - }, - actionId, - ); setAttributesToSpan(span, { actionId: actionId, @@ -702,19 +691,9 @@ function* runActionShortcutSaga() { }); if (!match || !match.params) return; - const { baseApiId, basePageId, baseQueryId } = match.params; + const { baseApiId, baseQueryId } = match.params; const actionId = baseApiId || baseQueryId; if (actionId) { - const trackerId = baseApiId - ? PerformanceTransactionName.RUN_API_SHORTCUT - : PerformanceTransactionName.RUN_QUERY_SHORTCUT; - PerformanceTracker.startTracking(trackerId, { - actionId, - basePageId, - }); - AnalyticsUtil.logEvent(trackerId as EventName, { - actionId, - }); yield put(runAction(actionId)); } else { return; @@ -1207,13 +1186,6 @@ function* executePageLoadAction( }), ); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.EXECUTE_ACTION, - { - failed: true, - }, - pageAction.id, - ); AnalyticsUtil.logEvent("EXECUTE_ACTION_FAILURE", { type: pageAction.pluginType, name: actionName, @@ -1256,11 +1228,6 @@ function* executePageLoadAction( ? actionExecutionContext : ActionExecutionContext.PAGE_LOAD, }); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.EXECUTE_ACTION, - undefined, - pageAction.id, - ); yield take(ReduxActionTypes.SET_EVALUATED_TREE); } @@ -1282,10 +1249,6 @@ function* executePageLoadActionsSaga( setAttributesToSpan(span, { numActions: actionCount }); // when cyclical depedency issue is there, // none of the page load actions would be executed - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.EXECUTE_PAGE_LOAD_ACTIONS, - { numActions: actionCount }, - ); for (const actionSet of pageActions) { // Load all sets in parallel // @ts-expect-error: no idea how to type this @@ -1300,9 +1263,6 @@ function* executePageLoadActionsSaga( ), ); } - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.EXECUTE_PAGE_LOAD_ACTIONS, - ); // We show errors in the debugger once onPageLoad actions // are executed yield put(hideDebuggerErrors(false)); @@ -1364,13 +1324,7 @@ function* executePluginActionSaga( throw new UserCancelledActionExecutionError(); } } - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.EXECUTE_ACTION, - { - actionId: actionId, - }, - actionId, - ); + yield put(executePluginActionRequest({ id: actionId })); const appMode: APP_MODE | undefined = yield select(getAppMode); @@ -1415,9 +1369,6 @@ function* executePluginActionSaga( response = yield ActionAPI.executeAction(formData, timeout, parentSpan); const isError = isErrorResponse(response); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.EXECUTE_ACTION, - ); yield validateResponse(response); payload = createActionExecutionResponse(response); diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index 716453a19a..1e4ebe6f68 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -85,9 +85,6 @@ import { } from "ee/selectors/entitiesSelector"; import history from "utils/history"; import { INTEGRATION_TABS } from "constants/routes"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import { ACTION_COPY_SUCCESS, ACTION_MOVE_SUCCESS, @@ -395,10 +392,7 @@ export function* fetchActionsSaga( action: EvaluationReduxAction, ) { const { applicationId, unpublishedActions } = action.payload; - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.FETCH_ACTIONS_API, - { mode: "EDITOR", appId: applicationId }, - ); + try { const response: ApiResponse = yield call( getFromServerWhenNoPrefetchedResult, @@ -413,19 +407,12 @@ export function* fetchActionsSaga( payload: response.data, postEvalActions: action.postEvalActions, }); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_ACTIONS_API, - ); } } catch (error) { yield put({ type: ReduxActionErrorTypes.FETCH_ACTIONS_ERROR, payload: { error }, }); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_ACTIONS_API, - { failed: true }, - ); } } @@ -433,10 +420,7 @@ export function* fetchActionsForViewModeSaga( action: ReduxAction, ) { const { applicationId, publishedActions } = action.payload; - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.FETCH_ACTIONS_API, - { mode: "VIEWER", appId: applicationId }, - ); + try { const response: ApiResponse = yield call( getFromServerWhenNoPrefetchedResult, @@ -464,18 +448,11 @@ export function* fetchActionsForViewModeSaga( payload: response.responseMeta.error, }); } - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_ACTIONS_API, - ); } catch (error) { yield put({ type: ReduxActionErrorTypes.FETCH_ACTIONS_VIEW_MODE_ERROR, payload: { error }, }); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_ACTIONS_API, - { failed: true }, - ); } } @@ -483,10 +460,7 @@ export function* fetchActionsForPageSaga( action: EvaluationReduxAction<{ pageId: string }>, ) { const { pageId } = action.payload; - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_ACTIONS_API, - { pageId: pageId }, - ); + try { const response: ApiResponse = yield call( ActionAPI.fetchActionsByPageId, @@ -495,16 +469,8 @@ export function* fetchActionsForPageSaga( const isValidResponse: boolean = yield validateResponse(response); if (isValidResponse) { yield put(fetchActionsForPageSuccess(response.data)); - // wait for success of - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_ACTIONS_API, - ); } } catch (error) { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.FETCH_PAGE_ACTIONS_API, - { failed: true }, - ); yield put({ type: ReduxActionErrorTypes.FETCH_ACTIONS_FOR_PAGE_ERROR, payload: { error }, @@ -514,11 +480,6 @@ export function* fetchActionsForPageSaga( export function* updateActionSaga(actionPayload: ReduxAction<{ id: string }>) { try { - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.UPDATE_ACTION_API, - { actionid: actionPayload.payload.id }, - ); - let action: Action = yield select(getAction, actionPayload.payload.id); if (!action) throw new Error("Could not find action to update"); @@ -571,20 +532,12 @@ export function* updateActionSaga(actionPayload: ReduxAction<{ id: string }>) { pageName, }); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.UPDATE_ACTION_API, - ); - yield put(updateActionSuccess({ data: response.data })); checkAndLogErrorsIfCyclicDependency( (response.data as Action).errorReports, ); } } catch (error) { - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.UPDATE_ACTION_API, - { failed: true }, - ); yield put({ type: ReduxActionErrorTypes.UPDATE_ACTION_ERROR, payload: { error, id: actionPayload.payload.id, show: false }, @@ -857,12 +810,6 @@ export function* refactorActionName( oldName: string, newName: string, ) { - // fetch page of the action - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.REFACTOR_ACTION_NAME, - { actionId: id }, - ); - const params: FetchPageRequest = { pageId, migrateDSL: true }; const pageResponse: FetchPageResponse = yield call(PageApi.fetchPage, params); // check if page request is successful @@ -884,10 +831,6 @@ export function* refactorActionName( const currentPageId: string = yield select(getCurrentPageId); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.REFACTOR_ACTION_NAME, - { isSuccess: isRefactorSuccessful }, - ); if (isRefactorSuccessful) { yield put({ type: ReduxActionTypes.SAVE_ACTION_NAME_SUCCESS, diff --git a/app/client/src/sagas/ApiPaneSagas.ts b/app/client/src/sagas/ApiPaneSagas.ts index 5ae9bb3fdb..6339111cd9 100644 --- a/app/client/src/sagas/ApiPaneSagas.ts +++ b/app/client/src/sagas/ApiPaneSagas.ts @@ -53,9 +53,6 @@ import type { import { PluginPackageName, PluginType } from "entities/Action"; import { getCurrentWorkspaceId } from "ee/selectors/selectedWorkspaceSelectors"; import log from "loglevel"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import type { EventLocation } from "ee/utils/analyticsUtilTypes"; import { createMessage, ERROR_ACTION_RENAME_FAIL } from "ee/constants/messages"; import { @@ -97,7 +94,6 @@ function* syncApiParamsSaga( //Payload here contains the path and query params of a typical url like https://{domain}/{path}?{query_params} const value = actionPayload.payload; // Regular expression to find the query params group - PerformanceTracker.startTracking(PerformanceTransactionName.SYNC_PARAMS_SAGA); if (field === "actionConfiguration.path") { const params = parseUrlForQueryParams(value); // before updating the query parameters make sure the path field changes have been successfully updated first @@ -135,7 +131,6 @@ function* syncApiParamsSaga( ), ); } - PerformanceTracker.stopTracking(); } function* handleUpdateBodyContentType( @@ -293,7 +288,6 @@ function* changeApiSaga( action?: Action; }>, ) { - PerformanceTracker.startTracking(PerformanceTransactionName.CHANGE_API_SAGA); const { id, isSaas } = actionPayload.payload; let { action } = actionPayload.payload; if (!action) action = yield select(getAction, id); @@ -329,7 +323,6 @@ function* changeApiSaga( getFormData, API_EDITOR_FORM_NAME, ); - PerformanceTracker.stopTracking(); yield put(updateReplayEntity(id, actionPostProcess, ENTITY_TYPE.ACTION)); } diff --git a/app/client/src/sagas/EvaluationsSaga.ts b/app/client/src/sagas/EvaluationsSaga.ts index bd7b9aafce..51c5954132 100644 --- a/app/client/src/sagas/EvaluationsSaga.ts +++ b/app/client/src/sagas/EvaluationsSaga.ts @@ -31,9 +31,6 @@ import { PropertyEvaluationErrorType } from "utils/DynamicBindingUtils"; import { EVAL_WORKER_ACTIONS } from "ee/workers/Evaluation/evalWorkerActions"; import log from "loglevel"; import type { WidgetProps } from "widgets/BaseWidget"; -import PerformanceTracker, { - PerformanceTransactionName, -} from "utils/PerformanceTracker"; import * as Sentry from "@sentry/react"; import type { Action } from "redux"; import { @@ -162,13 +159,6 @@ export function* updateDataTreeHandler( const appMode: ReturnType = yield select(getAppMode); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.DATA_TREE_EVALUATION, - ); - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.SET_EVALUATED_TREE, - ); - if (!isEmpty(staleMetaIds)) { yield put(resetWidgetsMetaState(staleMetaIds)); } @@ -177,10 +167,6 @@ export function* updateDataTreeHandler( ConfigTreeActions.setConfigTree(configTree); - PerformanceTracker.stopAsyncTracking( - PerformanceTransactionName.SET_EVALUATED_TREE, - ); - // if evalMetaUpdates are present only then dispatch updateMetaState if (evalMetaUpdates.length) { yield put(updateMetaState(evalMetaUpdates)); @@ -267,9 +253,7 @@ export function* evaluateTreeSaga( const theme: ReturnType = yield select(getSelectedAppTheme); log.debug({ unevalTree, configTree: unEvalAndConfigTree.configTree }); - PerformanceTracker.startAsyncTracking( - PerformanceTransactionName.DATA_TREE_EVALUATION, - ); + const appMode: ReturnType = yield select(getAppMode); const widgetsMeta: ReturnType = yield select(getWidgetsMeta); diff --git a/app/client/src/sagas/InitSagas.ts b/app/client/src/sagas/InitSagas.ts index b92a4268fb..639a114fbb 100644 --- a/app/client/src/sagas/InitSagas.ts +++ b/app/client/src/sagas/InitSagas.ts @@ -306,7 +306,6 @@ export function* startAppEngine(action: ReduxAction) { action.payload.mode, action.payload.mode, ); - engine.startPerformanceTracking(); yield call(engine.setupEngine, action.payload, rootSpan); const getInitResponsesSpan = startNestedSpan( @@ -344,7 +343,6 @@ export function* startAppEngine(action: ReduxAction) { yield call(engine.loadGit, applicationId, rootSpan); yield call(engine.completeChore, rootSpan); yield put(generateAutoHeightLayoutTreeAction(true, false)); - engine.stopPerformanceTracking(); } catch (e) { log.error(e); if (e instanceof AppEngineApiError) return; diff --git a/app/client/src/utils/PerformanceTracker.ts b/app/client/src/utils/PerformanceTracker.ts deleted file mode 100644 index 5aa17f4af6..0000000000 --- a/app/client/src/utils/PerformanceTracker.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Sentry from "@sentry/react"; -import type { Span } from "@sentry/tracing"; -import { SpanStatus } from "@sentry/tracing"; -import { getAppsmithConfigs } from "ee/configs"; -import _ from "lodash"; -import * as log from "loglevel"; - -export enum PerformanceTransactionName { - DATA_TREE_EVALUATION = "DATA_TREE_EVALUATION", - SET_EVALUATED_TREE = "SET_EVALUATED_TREE", - EXECUTE_PAGE_LOAD_ACTIONS = "EXECUTE_PAGE_LOAD_ACTIONS", - ENTITY_EXPLORER_ENTITY = "ENTITY_EXPLORER_ENTITY", - ENTITY_EXPLORER = "ENTITY_EXPLORER", - CLOSE_SIDE_PANE = "CLOSE_SIDE_PANE", - OPEN_ACTION = "OPEN_ACTION", - SIDE_BAR_MOUNT = "SIDE_BAR_MOUNT", - EXECUTE_ACTION = "EXECUTE_ACTION", - CHANGE_API_SAGA = "CHANGE_API_SAGA", - SYNC_PARAMS_SAGA = "SYNC_PARAMS_SAGA", - RUN_API_CLICK = "RUN_API_CLICK", - RUN_API_SHORTCUT = "RUN_API_SHORTCUT", - RUN_QUERY_CLICK = "RUN_QUERY_CLICK", - RUN_QUERY_SHORTCUT = "RUN_QUERY_SHORTCUT", - FETCH_ACTIONS_API = "FETCH_ACTIONS_API", - FETCH_PAGE_LIST_API = "FETCH_PAGE_LIST_API", - FETCH_PAGE_ACTIONS_API = "FETCH_PAGE_ACTIONS_API", - FETCH_PAGE_API = "FETCH_PAGE_API", - SAVE_PAGE_API = "SAVE_PAGE_API", - UPDATE_ACTION_API = "UPDATE_ACTION_API", - OPEN_PROPERTY_PANE = "OPEN_PROPERTY_PANE", - REFACTOR_ACTION_NAME = "REFACTOR_ACTION_NAME", - USER_ME_API = "USER_ME_API", - SIGN_UP = "SIGN_UP", - LOGIN_CLICK = "LOGIN_CLICK", - INIT_EDIT_APP = "INIT_EDIT_APP", - INIT_VIEW_APP = "INIT_VIEW_APP", - SHOW_RESIZE_HANDLES = "SHOW_RESIZE_HANDLES", -} - -export interface PerfTag { - name: string; - value: string; -} -export interface PerfLog { - sentrySpan: Span; - skipLog?: boolean; - eventName: string; -} - -const appsmithConfigs = getAppsmithConfigs(); - -class PerformanceTracker { - private static perfLogQueue: PerfLog[] = []; - private static perfAsyncMap: Map = new Map(); - - static startTracking = ( - eventName: PerformanceTransactionName, - // TODO: Fix this the next time the file is edited - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data?: any, - skipLog = false, - tags: Array = [], - ) => { - if (appsmithConfigs.sentry.enabled) { - const currentTransaction = Sentry.getCurrentHub() - .getScope() - ?.getTransaction(); - if ( - PerformanceTracker.perfLogQueue.length === 0 && - currentTransaction !== undefined && - currentTransaction.status === SpanStatus.Ok - ) { - PerformanceTracker.perfLogQueue.push({ - sentrySpan: currentTransaction, - skipLog: skipLog, - eventName: eventName, - }); - } - if (PerformanceTracker.perfLogQueue.length === 0) { - if (!skipLog) { - log.debug( - PerformanceTracker.generateSpaces( - PerformanceTracker.perfLogQueue.length + 1, - ) + - eventName + - " Track Transaction ", - ); - } - const newTransaction = Sentry.startTransaction({ name: eventName }); - - tags.forEach(({ name: tagName, value }) => { - newTransaction.setTag(tagName, value); - }); - - newTransaction.setData("startData", data); - Sentry.getCurrentHub().configureScope((scope) => - scope.setSpan(newTransaction), - ); - PerformanceTracker.perfLogQueue.push({ - sentrySpan: newTransaction, - skipLog: skipLog, - eventName: eventName, - }); - } else { - if (!skipLog) { - log.debug( - PerformanceTracker.generateSpaces( - PerformanceTracker.perfLogQueue.length + 1, - ) + - eventName + - " Track Span ", - ); - } - const currentPerfLog = - PerformanceTracker.perfLogQueue[ - PerformanceTracker.perfLogQueue.length - 1 - ]; - const currentRunningSpan = currentPerfLog.sentrySpan; - const span = currentRunningSpan.startChild({ - op: eventName, - data: data, - }); - PerformanceTracker.perfLogQueue.push({ - sentrySpan: span, - skipLog: skipLog, - eventName: eventName, - }); - } - } - }; - - static stopTracking = ( - eventName?: PerformanceTransactionName, - // TODO: Fix this the next time the file is edited - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data?: any, - ) => { - if (appsmithConfigs.sentry.enabled) { - if (eventName) { - const index = _.findLastIndex( - PerformanceTracker.perfLogQueue, - (perfLog) => { - return perfLog.eventName === eventName; - }, - ); - if (index !== -1) { - for ( - let i = PerformanceTracker.perfLogQueue.length - 1; - i >= index; - i-- - ) { - const perfLog = PerformanceTracker.perfLogQueue.pop(); - if (perfLog) { - const currentSpan = perfLog.sentrySpan; - currentSpan.finish(); - if (!perfLog?.skipLog) { - PerformanceTracker.printDuration( - perfLog.eventName, - i + 1, - currentSpan.startTimestamp, - currentSpan.endTimestamp, - ); - } - } - } - } - } else { - const perfLog = PerformanceTracker.perfLogQueue.pop(); - if (perfLog) { - const currentRunningSpan = perfLog?.sentrySpan; - currentRunningSpan.setData("endData", data); - currentRunningSpan.finish(); - if (!perfLog?.skipLog) { - PerformanceTracker.printDuration( - perfLog.eventName, - PerformanceTracker.perfLogQueue.length + 1, - currentRunningSpan.startTimestamp, - currentRunningSpan.endTimestamp, - ); - } - } - } - } - }; - - static startAsyncTracking = ( - eventName: PerformanceTransactionName, - // TODO: Fix this the next time the file is edited - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data?: any, - uniqueId?: string, - parentEventId?: string, - skipLog = false, - ) => { - if (!skipLog) { - log.debug( - "Async " + - PerformanceTracker.generateSpaces(0) + - eventName + - " Track Transaction ", - ); - } - if (!parentEventId) { - const newTransaction = Sentry.startTransaction({ name: eventName }); - newTransaction.setData("startData", data); - PerformanceTracker.perfAsyncMap.set(uniqueId ? uniqueId : eventName, { - sentrySpan: newTransaction, - eventName: eventName, - skipLog: skipLog, - }); - } else { - const perfLog = PerformanceTracker.perfAsyncMap.get(parentEventId); - const childSpan = perfLog?.sentrySpan.startChild({ - op: eventName, - data: data, - }); - if (childSpan) { - PerformanceTracker.perfAsyncMap.set(uniqueId ? uniqueId : eventName, { - sentrySpan: childSpan, - eventName: eventName, - skipLog: skipLog, - }); - } - } - }; - - static stopAsyncTracking( - eventName: PerformanceTransactionName, - // TODO: Fix this the next time the file is edited - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data?: any, - uniqueId?: string, - ) { - const perfLog = PerformanceTracker.perfAsyncMap.get( - uniqueId ? uniqueId : eventName, - ); - if (perfLog) { - const currentSpan = perfLog.sentrySpan; - currentSpan.setData("endData", data); - currentSpan.finish(); - if (!perfLog?.skipLog) { - PerformanceTracker.printDuration( - perfLog.eventName, - 0, - currentSpan.startTimestamp, - currentSpan.endTimestamp, - true, - ); - } - } - } - - static generateSpaces(num: number) { - let str = ""; - for (let i = 0; i < num; i++) { - str += "\t"; - } - return str; - } - - static printDuration( - eventName: string, - level: number, - startTime: number, - endTime?: number, - isAsync?: boolean, - ) { - const duration = ((endTime || 0) - startTime) * 1000; - const spaces = PerformanceTracker.generateSpaces(level); - log.debug( - (isAsync ? "Async " : "") + - spaces + - eventName + - " Finish Tracking in " + - duration + - "ms", - ); - } -} - -export default PerformanceTracker; diff --git a/app/client/yarn.lock b/app/client/yarn.lock index 1f13b6770a..c420b5376f 100644 --- a/app/client/yarn.lock +++ b/app/client/yarn.lock @@ -8473,19 +8473,6 @@ __metadata: languageName: node linkType: hard -"@sentry/tracing@npm:^6.2.4": - version: 6.2.4 - resolution: "@sentry/tracing@npm:6.2.4" - dependencies: - "@sentry/hub": 6.2.4 - "@sentry/minimal": 6.2.4 - "@sentry/types": 6.2.4 - "@sentry/utils": 6.2.4 - tslib: ^1.9.3 - checksum: 74fb1cf110e10fda9b5eac1c7e0eb92204311d336bcd30642a33fde3a3a0fd73ed8d13ea62e744059adf6bb84d638ec5a35e8d2b40af2f5ff3131c0fb70017a5 - languageName: node - linkType: hard - "@sentry/types@npm:6.2.4": version: 6.2.4 resolution: "@sentry/types@npm:6.2.4" @@ -13197,7 +13184,6 @@ __metadata: "@react-types/shared": ^3.23.0 "@redux-saga/testing-utils": ^1.1.5 "@sentry/react": ^6.2.4 - "@sentry/tracing": ^6.2.4 "@sentry/webpack-plugin": ^1.18.9 "@shared/ast": "workspace:^" "@shared/dsl": "workspace:^"