Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions static/app/components/replays/canvasReplayerPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
},
});
Expand Down Expand Up @@ -358,7 +356,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;
}

Expand Down
16 changes: 2 additions & 14 deletions static/app/components/replays/replayProcessingError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props {
className?: string;
}

export default function ReplayProcessingError({className, processingErrors}: Props) {
export default function ReplayProcessingError({className}: Props) {
const {replay} = useReplayContext();
const {sdk} = replay?.getReplay() || {};

Expand All @@ -25,20 +25,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 (
<StyledAlert type="error" showIcon className={className}>
Expand Down
3 changes: 0 additions & 3 deletions static/app/utils/metrics/useIncrementQueryMetric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
31 changes: 0 additions & 31 deletions static/app/utils/performanceForSentry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -605,28 +605,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;
Expand All @@ -643,15 +621,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,
},
});
}
});
});
Expand Down
25 changes: 0 additions & 25 deletions static/app/utils/replays/hooks/useLogReplayDataLoaded.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -231,7 +222,6 @@ function ImageContainer(props: {
<img
data-test-id="sample-image"
onError={handleError}
onLoad={handleLoad}
src={src}
style={{
width: '100%',
Expand Down
4 changes: 0 additions & 4 deletions static/app/views/metrics/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
useMemo,
useState,
} from 'react';
import * as Sentry from '@sentry/react';
import isEqual from 'lodash/isEqual';

import type {FocusAreaSelection} from 'sentry/components/metrics/chart/types';
Expand Down Expand Up @@ -316,18 +315,15 @@ export function MetricsContextProvider({children}: {children: React.ReactNode})
const handleAddFocusArea = useCallback(
(area: FocusAreaSelection) => {
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});
},
[handleSetSelectedWidgetIndex, updateQuery]
);

const handleRemoveFocusArea = useCallback(() => {
Sentry.metrics.increment('ddm.enhance.remove');
updateQuery({focusArea: undefined}, {replace: true});
}, [updateQuery]);

Expand Down
7 changes: 0 additions & 7 deletions static/app/views/metrics/layout.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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,
Expand All @@ -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,
});
Expand Down
4 changes: 0 additions & 4 deletions static/app/views/metrics/metricFormulaContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -46,7 +45,6 @@ export function MetricFormulaContextMenu({
trackAnalytics('ddm.widget.duplicate', {
organization,
});
Sentry.metrics.increment('ddm.widget.duplicate');
duplicateWidget(widgetIndex);
},
},
Expand Down Expand Up @@ -75,7 +73,6 @@ export function MetricFormulaContextMenu({
organization,
source: 'widget',
});
Sentry.metrics.increment('ddm.widget.dashboard');
createDashboardWidget?.();
},
},
Expand All @@ -85,7 +82,6 @@ export function MetricFormulaContextMenu({
label: t('Remove Equation'),
disabled: !canDelete,
onAction: () => {
Sentry.metrics.increment('ddm.widget.delete');
removeWidget(widgetIndex);
},
},
Expand Down
6 changes: 0 additions & 6 deletions static/app/views/metrics/metricQueryContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -76,7 +75,6 @@ export function MetricQueryContextMenu({
trackAnalytics('ddm.widget.duplicate', {
organization,
});
Sentry.metrics.increment('ddm.widget.duplicate');
duplicateWidget(widgetIndex);
},
};
Expand All @@ -91,7 +89,6 @@ export function MetricQueryContextMenu({
organization,
source: 'widget',
});
Sentry.metrics.increment('ddm.widget.alert');
createAlert?.();
},
};
Expand Down Expand Up @@ -130,7 +127,6 @@ export function MetricQueryContextMenu({
organization,
source: 'widget',
});
Sentry.metrics.increment('ddm.widget.dashboard');
createDashboardWidget?.();
},
};
Expand All @@ -144,7 +140,6 @@ export function MetricQueryContextMenu({
trackAnalytics('ddm.widget.settings', {
organization,
});
Sentry.metrics.increment('ddm.widget.settings');

if (!isVirtualMetric(metricsQuery)) {
navigateTo(
Expand All @@ -166,7 +161,6 @@ export function MetricQueryContextMenu({
trackAnalytics('ddm.widget.delete', {
organization,
});
Sentry.metrics.increment('ddm.widget.delete');
removeWidget(widgetIndex);
},
};
Expand Down
2 changes: 0 additions & 2 deletions static/app/views/metrics/metrics.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -25,7 +24,6 @@ function Metrics() {
trackAnalytics('ddm.page-view', {
organization,
});
Sentry.metrics.increment('ddm.visit');
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down
3 changes: 0 additions & 3 deletions static/app/views/metrics/pageHeaderActions.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
});
Expand Down
3 changes: 0 additions & 3 deletions static/app/views/metrics/shareButton.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -29,7 +27,6 @@ function ShareButton() {
size="sm"
icon={<IconUpload size="sm" />}
onClick={() => {
Sentry.metrics.increment('ddm.share');
openModal(deps => <ShareModal {...deps} />);
}}
>
Expand Down
7 changes: 0 additions & 7 deletions static/app/views/metrics/summaryTable.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
Expand Down
Loading
Loading