diff --git a/build-utils/sentry-instrumentation.ts b/build-utils/sentry-instrumentation.ts index e1c9e6da83ffca..5fbd23d501e45f 100644 --- a/build-utils/sentry-instrumentation.ts +++ b/build-utils/sentry-instrumentation.ts @@ -49,8 +49,8 @@ class SentryInstrumentation { environment: IS_CI ? 'ci' : 'local', tracesSampleRate: 1.0, integrations: [nodeProfilingIntegration()], - profilesSampler: ({transactionContext}) => { - if (transactionContext.name === INCREMENTAL_BUILD_TXN) { + profilesSampler: samplingContext => { + if (samplingContext.name === INCREMENTAL_BUILD_TXN) { return 0; } return 1; diff --git a/package.json b/package.json index 70584d7d07470a..ae95d2892bdc75 100644 --- a/package.json +++ b/package.json @@ -56,13 +56,11 @@ "@sentry-internal/rrweb": "2.26.0", "@sentry-internal/rrweb-player": "2.26.0", "@sentry-internal/rrweb-snapshot": "2.26.0", - "@sentry/core": "8.48.0", - "@sentry/node": "8.48.0", - "@sentry/react": "8.48.0", + "@sentry/core": "9.0.0-alpha.0", + "@sentry/node": "9.0.0-alpha.0", + "@sentry/react": "9.0.0-alpha.0", "@sentry/release-parser": "^1.3.1", "@sentry/status-page-list": "^0.6.0", - "@sentry/types": "8.48.0", - "@sentry/utils": "8.48.0", "@sentry/webpack-plugin": "^2.22.4", "@spotlightjs/spotlight": "^2.0.0-alpha.1", "@tanstack/react-query": "^5.64.1", @@ -182,7 +180,7 @@ "@eslint/js": "^9.17.0", "@pmmmwh/react-refresh-webpack-plugin": "0.5.15", "@sentry/jest-environment": "6.0.0", - "@sentry/profiling-node": "8.48.0", + "@sentry/profiling-node": "9.0.0-alpha.0", "@styled/typescript-styled-plugin": "^1.0.1", "@testing-library/dom": "10.1.0", "@testing-library/jest-dom": "6.4.5", diff --git a/static/app/components/assigneeBadge.stories.tsx b/static/app/components/assigneeBadge.stories.tsx index d087d6e37455f4..2eb832a03acbb1 100644 --- a/static/app/components/assigneeBadge.stories.tsx +++ b/static/app/components/assigneeBadge.stories.tsx @@ -1,5 +1,5 @@ import {Fragment, useState} from 'react'; -import {uuid4} from '@sentry/utils'; +import {uuid4} from '@sentry/core'; import {AssigneeBadge} from 'sentry/components/assigneeBadge'; import storyBook from 'sentry/stories/storyBook'; diff --git a/static/app/components/events/eventReplay/replayClipPreviewPlayer.tsx b/static/app/components/events/eventReplay/replayClipPreviewPlayer.tsx index d22b4435b41724..781b72bddce37c 100644 --- a/static/app/components/events/eventReplay/replayClipPreviewPlayer.tsx +++ b/static/app/components/events/eventReplay/replayClipPreviewPlayer.tsx @@ -135,9 +135,7 @@ function ReplayClipPreviewPlayer({ return ( {replayReaderResult.replay?.hasProcessingErrors() ? ( - + ) : ( {replay?.hasProcessingErrors() ? ( - + ) : ( diff --git a/static/app/components/feedback/widget/useFeedback.tsx b/static/app/components/feedback/widget/useFeedback.tsx index c186620af3b85a..743126693e2faf 100644 --- a/static/app/components/feedback/widget/useFeedback.tsx +++ b/static/app/components/feedback/widget/useFeedback.tsx @@ -31,6 +31,7 @@ export function useFeedback({ messagePlaceholder: messagePlaceholder ?? t('What did you expect?'), formTitle: formTitle ?? t('Give Feedback'), tags, + _experiments: {annotations: true}, }; }, [config.theme, formTitle, messagePlaceholder, tags]); diff --git a/static/app/components/modals/widgetViewerModal.tsx b/static/app/components/modals/widgetViewerModal.tsx index 311e8a27c1e455..19e2fa7aff28b4 100644 --- a/static/app/components/modals/widgetViewerModal.tsx +++ b/static/app/components/modals/widgetViewerModal.tsx @@ -2,8 +2,8 @@ import {Fragment, memo, useEffect, useMemo, useState} from 'react'; import {components} from 'react-select'; import {css} from '@emotion/react'; import styled from '@emotion/styled'; +import {truncate} from '@sentry/core'; import * as Sentry from '@sentry/react'; -import {truncate} from '@sentry/utils'; import type {Location} from 'history'; import cloneDeep from 'lodash/cloneDeep'; import isEqual from 'lodash/isEqual'; diff --git a/static/app/components/replays/canvasReplayerPlugin.tsx b/static/app/components/replays/canvasReplayerPlugin.tsx index a026dcdf0b1367..c2ffa20e305b2f 100644 --- a/static/app/components/replays/canvasReplayerPlugin.tsx +++ b/static/app/components/replays/canvasReplayerPlugin.tsx @@ -275,8 +275,6 @@ export function CanvasReplayerPlugin(events: eventWithTime[]): ReplayPlugin { errorHandler: (err: unknown) => { if (err instanceof Error) { Sentry.captureException(err); - } else { - Sentry.metrics.increment('replay.canvas_player.error_canvas_mutation'); } }, }); @@ -357,8 +355,6 @@ export function CanvasReplayerPlugin(events: eventWithTime[]): ReplayPlugin { function handleProcessEventError(err: unknown) { if (err instanceof InvalidCanvasNodeError) { - // This can throw if mirror DOM is not ready - Sentry.metrics.increment('replay.canvas_player.no_canvas_id'); return; } diff --git a/static/app/components/replays/replayProcessingError.tsx b/static/app/components/replays/replayProcessingError.tsx index 00269301a05cb8..3c1175a4eca672 100644 --- a/static/app/components/replays/replayProcessingError.tsx +++ b/static/app/components/replays/replayProcessingError.tsx @@ -10,11 +10,10 @@ import {space} from 'sentry/styles/space'; import {useReplayContext} from './replayContext'; interface Props { - processingErrors: readonly string[]; className?: string; } -export default function ReplayProcessingError({className, processingErrors}: Props) { +export default function ReplayProcessingError({className}: Props) { const {replay} = useReplayContext(); const {sdk} = replay?.getReplay() || {}; @@ -25,20 +24,8 @@ export default function ReplayProcessingError({className, processingErrors}: Pro if (sdk) { scope.setTag('sdk.version', sdk.version); } - processingErrors.forEach(error => { - Sentry.metrics.increment(`replay.processing-error`, 1, { - tags: { - 'sdk.version': sdk?.version ?? 'unknown', - // There are only 2 different error types - type: - error.toLowerCase() === 'missing meta frame' - ? 'missing-meta-frame' - : 'insufficient-replay-frames', - }, - }); - }); }); - }, [processingErrors, sdk]); + }, [sdk]); return ( diff --git a/static/app/components/replays/replayView.tsx b/static/app/components/replays/replayView.tsx index 8cc21c43221a32..765ad1face2627 100644 --- a/static/app/components/replays/replayView.tsx +++ b/static/app/components/replays/replayView.tsx @@ -51,7 +51,7 @@ function ReplayView({toggleFullscreen, isLoading}: Props) { ) : null} {!isFetching && replay?.hasProcessingErrors() ? ( - + ) : ( diff --git a/static/app/main.tsx b/static/app/main.tsx index 78ecc52a9c9726..2ac27bfb86a488 100644 --- a/static/app/main.tsx +++ b/static/app/main.tsx @@ -1,6 +1,6 @@ import {useState} from 'react'; import {createBrowserRouter, RouterProvider} from 'react-router-dom'; -import {wrapCreateBrowserRouter} from '@sentry/react'; +import {wrapCreateBrowserRouterV6} from '@sentry/react'; import {ReactQueryDevtools} from '@tanstack/react-query-devtools'; import DemoHeader from 'sentry/components/demo/demoHeader'; @@ -19,7 +19,7 @@ import {buildReactRouter6Routes} from './utils/reactRouter6Compat/router'; const queryClient = new QueryClient(DEFAULT_QUERY_CLIENT_CONFIG); function buildRouter() { - const sentryCreateBrowserRouter = wrapCreateBrowserRouter(createBrowserRouter); + const sentryCreateBrowserRouter = wrapCreateBrowserRouterV6(createBrowserRouter); const router = sentryCreateBrowserRouter(buildReactRouter6Routes(routes())); DANGEROUS_SET_REACT_ROUTER_6_HISTORY(router); diff --git a/static/app/utils/metrics/dashboard.tsx b/static/app/utils/metrics/dashboard.tsx index 8e86bcef955d78..90916a993f1070 100644 --- a/static/app/utils/metrics/dashboard.tsx +++ b/static/app/utils/metrics/dashboard.tsx @@ -1,4 +1,4 @@ -import {urlEncode} from '@sentry/utils'; +import * as qs from 'query-string'; import type {PageFilters} from 'sentry/types/core'; import {defined} from 'sentry/utils'; @@ -70,7 +70,7 @@ export function getWidgetEquation(equation: EquationParams): WidgetQuery { } export function encodeWidgetQuery(query: any) { - return urlEncode({ + return qs.stringify({ ...query, aggregates: query.aggregates.join(','), fields: query.fields?.join(','), diff --git a/static/app/utils/metrics/useIncrementQueryMetric.tsx b/static/app/utils/metrics/useIncrementQueryMetric.tsx index b01b91f3c8b7fc..0ca9918a05e710 100644 --- a/static/app/utils/metrics/useIncrementQueryMetric.tsx +++ b/static/app/utils/metrics/useIncrementQueryMetric.tsx @@ -28,9 +28,6 @@ export const useIncrementQueryMetric = (options: Options) => { isGrouped: !!mergedValues.groupBy?.length, isFiltered: !!mergedValues.query, }; - Sentry.metrics.increment(metricName, 1, { - tags, - }); const span = Sentry.getActiveSpan(); if (span) { diff --git a/static/app/utils/performanceForSentry/index.tsx b/static/app/utils/performanceForSentry/index.tsx index c7808b41fc0d3b..5162edb3533d92 100644 --- a/static/app/utils/performanceForSentry/index.tsx +++ b/static/app/utils/performanceForSentry/index.tsx @@ -1,12 +1,8 @@ import type {ProfilerOnRenderCallback, ReactNode} from 'react'; import {Fragment, Profiler, useEffect, useRef} from 'react'; import type {MeasurementUnit, Span, TransactionEvent} from '@sentry/core'; +import {browserPerformanceTimeOrigin, timestampInSeconds} from '@sentry/core'; import * as Sentry from '@sentry/react'; -import { - _browserPerformanceTimeOriginMode, - browserPerformanceTimeOrigin, - timestampInSeconds, -} from '@sentry/utils'; import {useLocation} from 'sentry/utils/useLocation'; import usePrevious from 'sentry/utils/usePrevious'; @@ -605,28 +601,6 @@ function isINPEntity(entry: PerformanceEntry): entry is INPPerformanceEntry { return entry.entryType === 'first-input'; } -function getNearestElementName(node: HTMLElement | undefined | null): string | undefined { - if (!node) { - return 'no-element'; - } - - let current: HTMLElement | null = node; - while (current && current !== document.body) { - const elementName = - current.dataset?.testId ?? - current.dataset?.sentryComponent ?? - current.dataset?.element; - - if (elementName) { - return elementName; - } - - current = current.parentElement; - } - - return `${node.tagName.toLowerCase()}.${node.className ?? ''}`; -} - export function makeIssuesINPObserver(): PerformanceObserver | undefined { if (!supportsINP()) { return undefined; @@ -643,15 +617,6 @@ export function makeIssuesINPObserver(): PerformanceObserver | undefined { if (entry.duration < 16) { return; } - - Sentry.metrics.distribution('issues-stream.inp', entry.duration, { - unit: 'millisecond', - tags: { - element: getNearestElementName(entry.target), - entryType: entry.entryType, - interaction: entry.name, - }, - }); } }); }); diff --git a/static/app/utils/profiling/routes.tsx b/static/app/utils/profiling/routes.tsx index 61556e6835c1a3..57f7d1a4ec21fc 100644 --- a/static/app/utils/profiling/routes.tsx +++ b/static/app/utils/profiling/routes.tsx @@ -1,4 +1,4 @@ -import {dropUndefinedKeys} from '@sentry/utils'; +import {dropUndefinedKeys} from '@sentry/core'; import type {Location, LocationDescriptor, Path} from 'history'; import type {Organization} from 'sentry/types/organization'; diff --git a/static/app/utils/profiling/spanTree.tsx b/static/app/utils/profiling/spanTree.tsx index 779ec4ca8eea91..c51d84fea17481 100644 --- a/static/app/utils/profiling/spanTree.tsx +++ b/static/app/utils/profiling/spanTree.tsx @@ -1,4 +1,4 @@ -import {uuid4} from '@sentry/utils'; +import {uuid4} from '@sentry/core'; import type {RawSpanType} from 'sentry/components/events/interfaces/spans/types'; import {isEventFromBrowserJavaScriptSDK} from 'sentry/components/events/interfaces/spans/utils'; diff --git a/static/app/utils/replays/hooks/useLogReplayDataLoaded.tsx b/static/app/utils/replays/hooks/useLogReplayDataLoaded.tsx index 36f9273c47adb3..0c68e40622f568 100644 --- a/static/app/utils/replays/hooks/useLogReplayDataLoaded.tsx +++ b/static/app/utils/replays/hooks/useLogReplayDataLoaded.tsx @@ -1,5 +1,4 @@ import {useEffect} from 'react'; -import * as Sentry from '@sentry/react'; import {trackAnalytics} from 'sentry/utils/analytics'; import type useLoadReplayReader from 'sentry/utils/replays/hooks/useLoadReplayReader'; @@ -59,30 +58,6 @@ function useLogReplayDataLoaded({fetchError, fetching, projectSlug, replay}: Pro replay_id: replayRecord.id, }); } - - const metricData = { - unit: 'millisecond', - tags: { - // This is a boolean to reduce cardinality -- technically this can - // match 7.8.x, but replay wasn't released in that version, so this should be fine - recentSdkVersion: replayRecord.sdk.version?.startsWith('7.8') ?? false, - }, - }; - - if (replay.timestampDeltas.startedAtDelta !== 0) { - Sentry.metrics.distribution( - 'replay.start-time-delta', - replay.timestampDeltas.startedAtDelta, - metricData - ); - } - if (replay.timestampDeltas.finishedAtDelta !== 0) { - Sentry.metrics.distribution( - 'replay.end-time-delta', - replay.timestampDeltas.finishedAtDelta, - metricData - ); - } }, [organization, project, fetchError, fetching, projectSlug, replay]); } diff --git a/static/app/views/alerts/rules/uptime/httpSnippet.spec.tsx b/static/app/views/alerts/rules/uptime/httpSnippet.spec.tsx index ede335fe518e19..15985a6bba5faf 100644 --- a/static/app/views/alerts/rules/uptime/httpSnippet.spec.tsx +++ b/static/app/views/alerts/rules/uptime/httpSnippet.spec.tsx @@ -1,11 +1,11 @@ -import {generateSentryTraceHeader} from '@sentry/utils'; +import {generateSentryTraceHeader} from '@sentry/core'; import {render, screen} from 'sentry-test/reactTestingLibrary'; import {HTTPSnippet} from './httpSnippet'; -jest.mock('@sentry/utils', () => ({ - ...jest.requireActual('@sentry/utils'), +jest.mock('@sentry/core', () => ({ + ...jest.requireActual('@sentry/core'), generateSentryTraceHeader: jest.fn(() => 'sentry-trace-value'), })); diff --git a/static/app/views/alerts/rules/uptime/httpSnippet.tsx b/static/app/views/alerts/rules/uptime/httpSnippet.tsx index 68e938c1498095..98026f63160ab5 100644 --- a/static/app/views/alerts/rules/uptime/httpSnippet.tsx +++ b/static/app/views/alerts/rules/uptime/httpSnippet.tsx @@ -1,6 +1,6 @@ import {useMemo} from 'react'; import styled from '@emotion/styled'; -import {generateSentryTraceHeader} from '@sentry/utils'; +import {generateSentryTraceHeader} from '@sentry/core'; import {CodeSnippet} from 'sentry/components/codeSnippet'; import {t} from 'sentry/locale'; diff --git a/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx b/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx index 9d559828391007..5b7fa488020a20 100644 --- a/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx @@ -1,4 +1,4 @@ -import {urlEncode} from '@sentry/utils'; +import * as qs from 'query-string'; import {DashboardFixture} from 'sentry-fixture/dashboard'; import {LocationFixture} from 'sentry-fixture/locationFixture'; import {MetricsFieldFixture} from 'sentry-fixture/metrics'; @@ -964,7 +964,7 @@ describe('WidgetBuilder', function () { renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.LINE, defaultTableColumns, }, @@ -999,7 +999,7 @@ describe('WidgetBuilder', function () { renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), }, }); @@ -1240,7 +1240,7 @@ describe('WidgetBuilder', function () { renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), defaultTableColumns, yAxis: ['equation|count_if(transaction.duration,equals,300)*2'], }, @@ -1521,7 +1521,7 @@ describe('WidgetBuilder', function () { orgFeatures: [...defaultOrgFeatures], query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.LINE, defaultTableColumns, }, @@ -1561,7 +1561,7 @@ describe('WidgetBuilder', function () { orgFeatures: [...defaultOrgFeatures], query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.LINE, defaultTableColumns, }, diff --git a/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx b/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx index 6a70e896736f2b..7c159826ae887d 100644 --- a/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx @@ -1,4 +1,4 @@ -import {urlEncode} from '@sentry/utils'; +import * as qs from 'query-string'; import {DashboardFixture} from 'sentry-fixture/dashboard'; import {LocationFixture} from 'sentry-fixture/locationFixture'; import {MetricsFieldFixture} from 'sentry-fixture/metrics'; @@ -928,7 +928,7 @@ describe('WidgetBuilder', function () { renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.TABLE, defaultTableColumns, }, @@ -980,7 +980,7 @@ describe('WidgetBuilder', function () { renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.TABLE, defaultTableColumns, }, @@ -1031,7 +1031,7 @@ describe('WidgetBuilder', function () { renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.TABLE, defaultTableColumns, }, diff --git a/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx b/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx index fbaa58f8976105..f8f29bdae185aa 100644 --- a/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx @@ -1,4 +1,4 @@ -import {urlEncode} from '@sentry/utils'; +import * as qs from 'query-string'; import {DashboardFixture} from 'sentry-fixture/dashboard'; import {LocationFixture} from 'sentry-fixture/locationFixture'; import {MetricsFieldFixture} from 'sentry-fixture/metrics'; @@ -396,7 +396,7 @@ describe('WidgetBuilder', function () { const {router} = renderTestComponent({ query: { source: DashboardWidgetSource.DISCOVERV2, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), displayType: DisplayType.TABLE, defaultTableColumns: ['title', 'count()', 'count_unique(user)', 'epm()'], }, diff --git a/static/app/views/discover/utils.tsx b/static/app/views/discover/utils.tsx index 50f7f69749e59b..06786d90d9a9c3 100644 --- a/static/app/views/discover/utils.tsx +++ b/static/app/views/discover/utils.tsx @@ -1,6 +1,6 @@ -import {urlEncode} from '@sentry/utils'; import type {Location, Query} from 'history'; import * as Papa from 'papaparse'; +import * as qs from 'query-string'; import {openAddToDashboardModal} from 'sentry/actionCreators/modal'; import {COL_WIDTH_UNDEFINED} from 'sentry/components/gridEditable'; @@ -887,7 +887,7 @@ export function constructAddQueryToDashboardLink({ start: eventView.start, end: eventView.end, statsPeriod: eventView.statsPeriod, - defaultWidgetQuery: urlEncode(defaultWidgetQuery), + defaultWidgetQuery: qs.stringify(defaultWidgetQuery), defaultTableColumns: defaultTableFields, defaultTitle, displayType: displayType === DisplayType.TOP_N ? DisplayType.AREA : displayType, diff --git a/static/app/views/insights/browser/resources/components/sampleImages.tsx b/static/app/views/insights/browser/resources/components/sampleImages.tsx index 30c39336cad9b0..e75923b93fd2e0 100644 --- a/static/app/views/insights/browser/resources/components/sampleImages.tsx +++ b/static/app/views/insights/browser/resources/components/sampleImages.tsx @@ -208,15 +208,6 @@ function ImageContainer(props: { const handleError = () => { setHasError(true); - Sentry.metrics.increment('performance.resource.image_load', 1, { - tags: {status: 'error'}, - }); - }; - - const handleLoad = () => { - Sentry.metrics.increment('performance.resource.image_load', 1, { - tags: {status: 'success'}, - }); }; return ( @@ -231,7 +222,6 @@ function ImageContainer(props: { { if (!area.range.start || !area.range.end) { - Sentry.metrics.increment('ddm.enhance.range-undefined'); return; } - Sentry.metrics.increment('ddm.enhance.add'); handleSetSelectedWidgetIndex(area.widgetIndex); updateQuery({focusArea: JSON.stringify(area)}, {replace: true}); }, @@ -327,7 +324,6 @@ export function MetricsContextProvider({children}: {children: React.ReactNode}) ); const handleRemoveFocusArea = useCallback(() => { - Sentry.metrics.increment('ddm.enhance.remove'); updateQuery({focusArea: undefined}, {replace: true}); }, [updateQuery]); diff --git a/static/app/views/metrics/layout.tsx b/static/app/views/metrics/layout.tsx index 5d1e3924c6927b..becc66ab2c3061 100644 --- a/static/app/views/metrics/layout.tsx +++ b/static/app/views/metrics/layout.tsx @@ -1,6 +1,5 @@ import {Fragment, memo, useCallback} from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; import emptyStateImg from 'sentry-images/spot/custom-metrics-empty-state.svg'; @@ -71,11 +70,6 @@ export const MetricsLayout = memo(() => { const addCustomMetric = useCallback( (referrer: 'header' | 'onboarding_panel' | 'banner') => { - Sentry.metrics.increment('ddm.add_custom_metric', 1, { - tags: { - referrer, - }, - }); trackAnalytics('ddm.open-onboarding', { organization, source: referrer, @@ -86,7 +80,6 @@ export const MetricsLayout = memo(() => { ); const viewPerformanceMetrics = useCallback(() => { - Sentry.metrics.increment('ddm.view_performance_metrics', 1); trackAnalytics('ddm.view_performance_metrics', { organization, }); diff --git a/static/app/views/metrics/metricFormulaContextMenu.tsx b/static/app/views/metrics/metricFormulaContextMenu.tsx index fa067db0bb4188..c2c34362840089 100644 --- a/static/app/views/metrics/metricFormulaContextMenu.tsx +++ b/static/app/views/metrics/metricFormulaContextMenu.tsx @@ -1,6 +1,5 @@ import {useMemo} from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; import Feature from 'sentry/components/acl/feature'; import type {MenuItemProps} from 'sentry/components/dropdownMenu'; @@ -46,7 +45,6 @@ export function MetricFormulaContextMenu({ trackAnalytics('ddm.widget.duplicate', { organization, }); - Sentry.metrics.increment('ddm.widget.duplicate'); duplicateWidget(widgetIndex); }, }, @@ -75,7 +73,6 @@ export function MetricFormulaContextMenu({ organization, source: 'widget', }); - Sentry.metrics.increment('ddm.widget.dashboard'); createDashboardWidget?.(); }, }, @@ -85,7 +82,6 @@ export function MetricFormulaContextMenu({ label: t('Remove Equation'), disabled: !canDelete, onAction: () => { - Sentry.metrics.increment('ddm.widget.delete'); removeWidget(widgetIndex); }, }, diff --git a/static/app/views/metrics/metricQueryContextMenu.tsx b/static/app/views/metrics/metricQueryContextMenu.tsx index 934d7c45badfd5..b098fc32acd1c9 100644 --- a/static/app/views/metrics/metricQueryContextMenu.tsx +++ b/static/app/views/metrics/metricQueryContextMenu.tsx @@ -1,5 +1,4 @@ import {useMemo} from 'react'; -import * as Sentry from '@sentry/react'; import {openAddToDashboardModal} from 'sentry/actionCreators/modal'; import {navigateTo} from 'sentry/actionCreators/navigation'; @@ -76,7 +75,6 @@ export function MetricQueryContextMenu({ trackAnalytics('ddm.widget.duplicate', { organization, }); - Sentry.metrics.increment('ddm.widget.duplicate'); duplicateWidget(widgetIndex); }, }; @@ -91,7 +89,6 @@ export function MetricQueryContextMenu({ organization, source: 'widget', }); - Sentry.metrics.increment('ddm.widget.alert'); createAlert?.(); }, }; @@ -130,7 +127,6 @@ export function MetricQueryContextMenu({ organization, source: 'widget', }); - Sentry.metrics.increment('ddm.widget.dashboard'); createDashboardWidget?.(); }, }; @@ -144,7 +140,6 @@ export function MetricQueryContextMenu({ trackAnalytics('ddm.widget.settings', { organization, }); - Sentry.metrics.increment('ddm.widget.settings'); if (!isVirtualMetric(metricsQuery)) { navigateTo( @@ -166,7 +161,6 @@ export function MetricQueryContextMenu({ trackAnalytics('ddm.widget.delete', { organization, }); - Sentry.metrics.increment('ddm.widget.delete'); removeWidget(widgetIndex); }, }; diff --git a/static/app/views/metrics/metrics.tsx b/static/app/views/metrics/metrics.tsx index eb40ae8c83f73f..0cd62fb94d5118 100644 --- a/static/app/views/metrics/metrics.tsx +++ b/static/app/views/metrics/metrics.tsx @@ -1,5 +1,4 @@ import {useEffect} from 'react'; -import * as Sentry from '@sentry/react'; import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container'; import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; @@ -25,7 +24,6 @@ function Metrics() { trackAnalytics('ddm.page-view', { organization, }); - Sentry.metrics.increment('ddm.visit'); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/static/app/views/metrics/pageHeaderActions.tsx b/static/app/views/metrics/pageHeaderActions.tsx index 8bc1fe9bbb545d..792f5dcece6187 100644 --- a/static/app/views/metrics/pageHeaderActions.tsx +++ b/static/app/views/metrics/pageHeaderActions.tsx @@ -1,6 +1,5 @@ import {useCallback, useMemo} from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; import {navigateTo} from 'sentry/actionCreators/navigation'; import Feature from 'sentry/components/acl/feature'; @@ -51,13 +50,11 @@ export function PageHeaderActions({showAddMetricButton, addCustomMetric}: Props) const handleToggleDefaultQuery = useCallback(() => { if (isDefaultQuery) { - Sentry.metrics.increment('ddm.remove-default-query'); trackAnalytics('ddm.remove-default-query', { organization, }); setDefaultQuery(null); } else { - Sentry.metrics.increment('ddm.set-default-query'); trackAnalytics('ddm.set-default-query', { organization, }); diff --git a/static/app/views/metrics/shareButton.tsx b/static/app/views/metrics/shareButton.tsx index 387c83daef657f..138871addee4e6 100644 --- a/static/app/views/metrics/shareButton.tsx +++ b/static/app/views/metrics/shareButton.tsx @@ -1,5 +1,3 @@ -import * as Sentry from '@sentry/react'; - import {openModal} from 'sentry/actionCreators/modal'; import {Button} from 'sentry/components/button'; import TextCopyInput from 'sentry/components/textCopyInput'; @@ -29,7 +27,6 @@ function ShareButton() { size="sm" icon={} onClick={() => { - Sentry.metrics.increment('ddm.share'); openModal(deps => ); }} > diff --git a/static/app/views/metrics/summaryTable.tsx b/static/app/views/metrics/summaryTable.tsx index b28af3067dde0b..d0b92a47e6a2c0 100644 --- a/static/app/views/metrics/summaryTable.tsx +++ b/static/app/views/metrics/summaryTable.tsx @@ -1,6 +1,5 @@ import {Fragment, memo, useCallback} from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; import colorFn from 'color'; import {Button, LinkButton} from 'sentry/components/button'; @@ -62,12 +61,6 @@ export const SummaryTable = memo(function SummaryTable({ by: name ?? '(none)', order: sort.order, }); - Sentry.metrics.increment('ddm.widget.sort', 1, { - tags: { - by: name ?? '(none)', - order: sort.order, - }, - }); if (sort.name === name) { if (sort.order === 'desc') { onSortChange(DEFAULT_SORT_STATE as SortState); diff --git a/static/app/views/metrics/widget.tsx b/static/app/views/metrics/widget.tsx index 08a948c845e05b..43d0c6aaef7348 100644 --- a/static/app/views/metrics/widget.tsx +++ b/static/app/views/metrics/widget.tsx @@ -1,6 +1,5 @@ import {Fragment, memo, useCallback, useMemo} from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; import type {SeriesOption} from 'echarts'; import moment from 'moment-timezone'; @@ -163,7 +162,6 @@ export const MetricWidget = memo( ); const handleDisplayTypeChange = ({value}: SelectOption) => { - Sentry.metrics.increment('ddm.widget.display'); onChange(index, {displayType: value}); }; @@ -172,13 +170,6 @@ export const MetricWidget = memo( ) => { const values = options.map(({value}) => value); - Sentry.metrics.increment('ddm.widget.overlay', 1, { - tags: { - releases: values.includes(MetricChartOverlayType.RELEASES), - samples: values.includes(MetricChartOverlayType.SAMPLES), - }, - }); - onChange(index, {overlays: values}); }; const samples = useMemo(() => { @@ -407,7 +398,6 @@ const MetricWidgetBody = memo( const handleZoom = useCallback( (range: DateTimeObject) => { - Sentry.metrics.increment('ddm.enhance.zoom'); updateDateTime(range, router, {save: true}); }, [router] diff --git a/static/app/views/performance/newTraceDetails/traceAnalytics.tsx b/static/app/views/performance/newTraceDetails/traceAnalytics.tsx index bd0a6390a93b9d..a7c9c92394db96 100644 --- a/static/app/views/performance/newTraceDetails/traceAnalytics.tsx +++ b/static/app/views/performance/newTraceDetails/traceAnalytics.tsx @@ -13,8 +13,6 @@ const trackTraceMetadata = ( organization: Organization, hasExceededPerformanceUsageLimit: boolean | null ) => { - Sentry.metrics.increment(`trace.trace_shape.${tree.shape}`); - // space[1] represents the node duration (in milliseconds) const trace_duration_seconds = (tree.root.space?.[1] ?? 0) / 1000; const projectSlugs = [ @@ -42,11 +40,6 @@ const trackTraceMetadata = ( }); }; -const trackFailedToFetchTraceState = () => - Sentry.metrics.increment('trace.failed_to_fetch_trace'); - -const trackEmptyTraceState = () => Sentry.metrics.increment('trace.empty_trace'); - const trackLayoutChange = (layout: string, organization: Organization) => trackAnalytics('trace.trace_layout.change', { layout, @@ -207,8 +200,6 @@ const traceAnalytics = { // Trace shape trackTraceMetadata, trackTraceShape, - trackEmptyTraceState, - trackFailedToFetchTraceState, // Drawer actions trackShowInView, trackViewEventJSON, diff --git a/static/app/views/performance/newTraceDetails/traceModels/traceTreeTestUtils.tsx b/static/app/views/performance/newTraceDetails/traceModels/traceTreeTestUtils.tsx index de2e53c86c96dc..cd930da5cc8be6 100644 --- a/static/app/views/performance/newTraceDetails/traceModels/traceTreeTestUtils.tsx +++ b/static/app/views/performance/newTraceDetails/traceModels/traceTreeTestUtils.tsx @@ -1,4 +1,4 @@ -import {uuid4} from '@sentry/utils'; +import {uuid4} from '@sentry/core'; import {EntryType, type Event, type EventTransaction} from 'sentry/types/event'; import type { diff --git a/static/app/views/performance/newTraceDetails/traceWaterfallState.tsx b/static/app/views/performance/newTraceDetails/traceWaterfallState.tsx index d4698343ef8f31..16c72edfa728d2 100644 --- a/static/app/views/performance/newTraceDetails/traceWaterfallState.tsx +++ b/static/app/views/performance/newTraceDetails/traceWaterfallState.tsx @@ -1,10 +1,9 @@ -import {useEffect, useRef} from 'react'; +import {useRef} from 'react'; import styled from '@emotion/styled'; import useFeedbackWidget from 'sentry/components/feedback/widget/useFeedbackWidget'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import {t} from 'sentry/locale'; -import {traceAnalytics} from 'sentry/views/performance/newTraceDetails/traceAnalytics'; function TraceLoading() { return ( @@ -21,10 +20,6 @@ function TraceError() { const linkref = useRef(null); const feedback = useFeedbackWidget({buttonRef: linkref}); - useEffect(() => { - traceAnalytics.trackFailedToFetchTraceState(); - }, []); - return (
{t('Ughhhhh, we failed to load your trace...')}
@@ -48,10 +43,6 @@ function TraceEmpty() { const linkref = useRef(null); const feedback = useFeedbackWidget({buttonRef: linkref}); - useEffect(() => { - traceAnalytics.trackEmptyTraceState(); - }, []); - return (
{t('This trace does not contain any data?!')}
diff --git a/static/app/views/performance/transactionSummary/pageLayout.tsx b/static/app/views/performance/transactionSummary/pageLayout.tsx index 6365c831439645..c34147c14c0b85 100644 --- a/static/app/views/performance/transactionSummary/pageLayout.tsx +++ b/static/app/views/performance/transactionSummary/pageLayout.tsx @@ -1,6 +1,6 @@ import {useCallback, useState} from 'react'; import styled from '@emotion/styled'; -import {isString} from '@sentry/utils'; +import {isString} from '@sentry/core'; import type {Location} from 'history'; import {addErrorMessage} from 'sentry/actionCreators/indicator'; diff --git a/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx b/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx index 975682a1469cb2..4bb6e837c00945 100644 --- a/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx +++ b/static/app/views/performance/transactionSummary/transactionTags/tagsHeatMap.tsx @@ -5,7 +5,7 @@ import {useTheme} from '@emotion/react'; import styled from '@emotion/styled'; import {useOverlay} from '@react-aria/overlays'; import {useOverlayTriggerState} from '@react-stately/overlays'; -import {truncate} from '@sentry/utils'; +import {truncate} from '@sentry/core'; import type {VisualMapComponentOption} from 'echarts'; import type {Location} from 'history'; import memoize from 'lodash/memoize'; diff --git a/static/app/views/profiling/continuousProfileProvider.spec.tsx b/static/app/views/profiling/continuousProfileProvider.spec.tsx index 1f6add35907354..cd9168325a6d9e 100644 --- a/static/app/views/profiling/continuousProfileProvider.spec.tsx +++ b/static/app/views/profiling/continuousProfileProvider.spec.tsx @@ -1,5 +1,5 @@ +import {uuid4} from '@sentry/core'; import * as Sentry from '@sentry/react'; -import {uuid4} from '@sentry/utils'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {render, waitFor} from 'sentry-test/reactTestingLibrary'; diff --git a/static/app/views/settings/projectMetrics/projectMetrics.tsx b/static/app/views/settings/projectMetrics/projectMetrics.tsx index aa46ab54e0990b..03257c8830633d 100644 --- a/static/app/views/settings/projectMetrics/projectMetrics.tsx +++ b/static/app/views/settings/projectMetrics/projectMetrics.tsx @@ -1,5 +1,4 @@ import {Fragment} from 'react'; -import * as Sentry from '@sentry/react'; import {Button} from 'sentry/components/button'; import ExternalLink from 'sentry/components/links/externalLink'; @@ -34,11 +33,6 @@ function ProjectMetrics({project, organization}: Props) {