Skip to content
Closed
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
4 changes: 2 additions & 2 deletions build-utils/sentry-instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/assigneeBadge.stories.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ function ReplayClipPreviewPlayer({
return (
<PlayerContainer data-test-id="player-container" isLarge={isLarge}>
{replayReaderResult.replay?.hasProcessingErrors() ? (
<ReplayProcessingError
processingErrors={replayReaderResult.replay.processingErrors()}
/>
<ReplayProcessingError />
) : (
<ReplayPreviewPlayer
replayId={replayReaderResult.replayId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function StaticReplayPreview({
>
<PlayerContainer data-test-id="player-container">
{replay?.hasProcessingErrors() ? (
<ReplayProcessingError processingErrors={replay.processingErrors()} />
<ReplayProcessingError />
) : (
<Fragment>
<StaticPanel>
Expand Down
1 change: 1 addition & 0 deletions static/app/components/feedback/widget/useFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 1 addition & 1 deletion static/app/components/modals/widgetViewerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 0 additions & 4 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 @@ -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;
}

Expand Down
17 changes: 2 additions & 15 deletions static/app/components/replays/replayProcessingError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() || {};

Expand All @@ -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 (
<StyledAlert type="error" showIcon className={className}>
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/replays/replayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function ReplayView({toggleFullscreen, isLoading}: Props) {
) : null}
</ContextContainer>
{!isFetching && replay?.hasProcessingErrors() ? (
<ReplayProcessingError processingErrors={replay.processingErrors()} />
<ReplayProcessingError />
) : (
<FluidHeight>
<CanvasSupportNotice />
Expand Down
4 changes: 2 additions & 2 deletions static/app/main.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions static/app/utils/metrics/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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(','),
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
37 changes: 1 addition & 36 deletions static/app/utils/performanceForSentry/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -354,7 +350,7 @@
const context: MeasurementContext = {
transaction,
ttfb: ttfbValue,
browserTimeOrigin: browserPerformanceTimeOrigin,

Check failure on line 353 in static/app/utils/performanceForSentry/index.tsx

View workflow job for this annotation

GitHub Actions / self-hosted

Type '() => number | undefined' is not assignable to type 'number'.
transactionStart: transaction.start_timestamp,
transactionOp: (transaction.contexts?.trace?.op as string) ?? 'pageload',
};
Expand Down Expand Up @@ -605,28 +601,6 @@
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 +617,6 @@
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
2 changes: 1 addition & 1 deletion static/app/utils/profiling/routes.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion static/app/utils/profiling/spanTree.tsx
Original file line number Diff line number Diff line change
@@ -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';
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
6 changes: 3 additions & 3 deletions static/app/views/alerts/rules/uptime/httpSnippet.spec.tsx
Original file line number Diff line number Diff line change
@@ -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'),
}));

Expand Down
2 changes: 1 addition & 1 deletion static/app/views/alerts/rules/uptime/httpSnippet.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -964,7 +964,7 @@ describe('WidgetBuilder', function () {
renderTestComponent({
query: {
source: DashboardWidgetSource.DISCOVERV2,
defaultWidgetQuery: urlEncode(defaultWidgetQuery),
defaultWidgetQuery: qs.stringify(defaultWidgetQuery),
displayType: DisplayType.LINE,
defaultTableColumns,
},
Expand Down Expand Up @@ -999,7 +999,7 @@ describe('WidgetBuilder', function () {
renderTestComponent({
query: {
source: DashboardWidgetSource.DISCOVERV2,
defaultWidgetQuery: urlEncode(defaultWidgetQuery),
defaultWidgetQuery: qs.stringify(defaultWidgetQuery),
},
});

Expand Down Expand Up @@ -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'],
},
Expand Down Expand Up @@ -1521,7 +1521,7 @@ describe('WidgetBuilder', function () {
orgFeatures: [...defaultOrgFeatures],
query: {
source: DashboardWidgetSource.DISCOVERV2,
defaultWidgetQuery: urlEncode(defaultWidgetQuery),
defaultWidgetQuery: qs.stringify(defaultWidgetQuery),
displayType: DisplayType.LINE,
defaultTableColumns,
},
Expand Down Expand Up @@ -1561,7 +1561,7 @@ describe('WidgetBuilder', function () {
orgFeatures: [...defaultOrgFeatures],
query: {
source: DashboardWidgetSource.DISCOVERV2,
defaultWidgetQuery: urlEncode(defaultWidgetQuery),
defaultWidgetQuery: qs.stringify(defaultWidgetQuery),
displayType: DisplayType.LINE,
defaultTableColumns,
},
Expand Down
Loading
Loading