Skip to content

Commit 36ebaaf

Browse files
authored
ref(insights): remove eap conditions web vitals (#95228)
remove eap conditions in webvitals now that its 100% GA
1 parent d9f2d7c commit 36ebaaf

20 files changed

+46
-367
lines changed

static/app/views/insights/browser/webVitals/components/charts/webVitalStatusLineChart.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import type {Plottable} from 'sentry/views/dashboards/widgets/timeSeriesWidget/p
66
import {Thresholds} from 'sentry/views/dashboards/widgets/timeSeriesWidget/plottables/thresholds';
77
import {WEB_VITAL_FULL_NAME_MAP} from 'sentry/views/insights/browser/webVitals/components/webVitalDescription';
88
import {Referrer} from 'sentry/views/insights/browser/webVitals/referrers';
9-
import {FIELD_ALIASES} from 'sentry/views/insights/browser/webVitals/settings';
9+
import {
10+
DEFAULT_QUERY_FILTER,
11+
FIELD_ALIASES,
12+
} from 'sentry/views/insights/browser/webVitals/settings';
1013
import type {WebVitals} from 'sentry/views/insights/browser/webVitals/types';
1114
import type {BrowserType} from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
1215
import {
1316
PERFORMANCE_SCORE_MEDIANS,
1417
PERFORMANCE_SCORE_P90S,
1518
} from 'sentry/views/insights/browser/webVitals/utils/scoreThresholds';
16-
import {useDefaultWebVitalsQuery} from 'sentry/views/insights/browser/webVitals/utils/useDefaultQuery';
1719
// eslint-disable-next-line no-restricted-imports
1820
import {InsightsLineChartWidget} from 'sentry/views/insights/common/components/insightsLineChartWidget';
1921
import type {DiscoverSeries} from 'sentry/views/insights/common/queries/useDiscoverSeries';
@@ -34,11 +36,10 @@ export function WebVitalStatusLineChart({
3436
browserTypes,
3537
subregions,
3638
}: Props) {
37-
const defaultQuery = useDefaultWebVitalsQuery();
3839
const webVitalP90 = webVital ? PERFORMANCE_SCORE_P90S[webVital] : 0;
3940
const webVitalMedian = webVital ? PERFORMANCE_SCORE_MEDIANS[webVital] : 0;
4041

41-
const search = new MutableSearch(defaultQuery);
42+
const search = new MutableSearch(DEFAULT_QUERY_FILTER);
4243
const referrer = Referrer.WEB_VITAL_STATUS_LINE_CHART;
4344

4445
if (transaction) {

static/app/views/insights/browser/webVitals/components/pageOverviewWebVitalsDetailPanel.tsx

Lines changed: 3 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {useProjectRawWebVitalsQuery} from 'sentry/views/insights/browser/webVita
2929
import {getWebVitalScoresFromTableDataRow} from 'sentry/views/insights/browser/webVitals/queries/storedScoreQueries/getWebVitalScoresFromTableDataRow';
3030
import {useProjectWebVitalsScoresQuery} from 'sentry/views/insights/browser/webVitals/queries/storedScoreQueries/useProjectWebVitalsScoresQuery';
3131
import {useSpanSamplesCategorizedQuery} from 'sentry/views/insights/browser/webVitals/queries/useSpanSamplesCategorizedQuery';
32-
import {useTransactionSamplesCategorizedQuery} from 'sentry/views/insights/browser/webVitals/queries/useTransactionSamplesCategorizedQuery';
3332
import type {
3433
SpanSampleRowWithScore,
3534
TransactionSampleRowWithScore,
@@ -38,7 +37,6 @@ import type {
3837
import decodeBrowserTypes from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
3938
import useProfileExists from 'sentry/views/insights/browser/webVitals/utils/useProfileExists';
4039
import {SampleDrawerBody} from 'sentry/views/insights/common/components/sampleDrawerBody';
41-
import {useInsightsEap} from 'sentry/views/insights/common/utils/useEap';
4240
import {useDomainViewFilters} from 'sentry/views/insights/pages/useFilters';
4341
import {SpanIndexedField, type SubregionCode} from 'sentry/views/insights/types';
4442
import {TraceViewSources} from 'sentry/views/performance/newTraceDetails/traceHeader/breadcrumbs';
@@ -85,7 +83,6 @@ export function PageOverviewWebVitalsDetailPanel({
8583
const routes = useRoutes();
8684
const {replayExists} = useReplayExists();
8785
const domainViewFilters = useDomainViewFilters();
88-
const useEap = useInsightsEap();
8986

9087
const browserTypes = decodeBrowserTypes(location.query[SpanIndexedField.BROWSER_NAME]);
9188
const subregions = location.query[
@@ -124,24 +121,11 @@ export function PageOverviewWebVitalsDetailPanel({
124121

125122
const projectScore = getWebVitalScoresFromTableDataRow(projectScoresData?.[0]);
126123

127-
const {data: transactionsTableData, isLoading: isTransactionWebVitalsQueryLoading} =
128-
useTransactionSamplesCategorizedQuery({
129-
transaction: transaction ?? '',
130-
webVital,
131-
enabled:
132-
Boolean(webVital) &&
133-
!useEap &&
134-
(!isInp || (!isSpansWebVital && useSpansWebVitals)),
135-
browserTypes,
136-
subregions,
137-
});
138-
139124
const {data: spansTableData, isLoading: isSpansLoading} =
140125
useSpanSamplesCategorizedQuery({
141126
transaction: transaction ?? '',
142127
webVital,
143-
enabled:
144-
Boolean(webVital) && (useEap || isInp || (isSpansWebVital && useSpansWebVitals)),
128+
enabled: Boolean(webVital),
145129
browserTypes,
146130
subregions,
147131
});
@@ -150,10 +134,6 @@ export function PageOverviewWebVitalsDetailPanel({
150134
spansTableData.filter(row => row['profile.id']).map(row => row['profile.id'])
151135
);
152136

153-
const getProjectSlug = (row: TransactionSampleRowWithScore): string => {
154-
return project && !Array.isArray(location.query.project) ? project.slug : row.project;
155-
};
156-
157137
const renderHeadCell = (col: Column) => {
158138
if (col.key === 'transaction') {
159139
return <NoOverflow>{col.name}</NoOverflow>;
@@ -192,99 +172,6 @@ export function PageOverviewWebVitalsDetailPanel({
192172
return getDuration(value / 1000, 2, true);
193173
};
194174

195-
const renderBodyCell = (col: Column, row: TransactionSampleRowWithScore) => {
196-
const {key} = col;
197-
const projectSlug = getProjectSlug(row);
198-
if (key === 'score') {
199-
if (row[`measurements.${webVital}` as keyof typeof row] !== undefined) {
200-
return (
201-
<AlignCenter>
202-
<PerformanceBadge
203-
score={row[`${webVital}Score` as keyof typeof row] as number}
204-
/>
205-
</AlignCenter>
206-
);
207-
}
208-
return null;
209-
}
210-
if (col.key === 'webVital') {
211-
// @ts-expect-error TS(2551): Property 'measurements.null' does not exist on typ... Remove this comment to see the full error message
212-
const value = row[`measurements.${webVital}`];
213-
if (value === undefined) {
214-
return (
215-
<AlignRight>
216-
<NoValue>{t('(no value)')}</NoValue>
217-
</AlignRight>
218-
);
219-
}
220-
const formattedValue =
221-
webVital === 'cls' ? value?.toFixed(2) : getFormattedDuration(value);
222-
return <AlignRight>{formattedValue}</AlignRight>;
223-
}
224-
if (key === 'id') {
225-
const eventTarget = generateLinkToEventInTraceView({
226-
eventId: row.id,
227-
traceSlug: row.trace,
228-
timestamp: row.timestamp,
229-
organization,
230-
location,
231-
view: domainViewFilters.view,
232-
source: TraceViewSources.WEB_VITALS_MODULE,
233-
});
234-
return (
235-
<NoOverflow>
236-
<Link to={eventTarget}>{getShortEventId(row.id)}</Link>
237-
</NoOverflow>
238-
);
239-
}
240-
if (key === 'replayId') {
241-
const replayTarget =
242-
row['transaction.duration'] !== undefined &&
243-
replayLinkGenerator(
244-
organization,
245-
{
246-
replayId: row.replayId,
247-
id: row.id,
248-
'transaction.duration': row['transaction.duration'],
249-
timestamp: row.timestamp,
250-
},
251-
undefined
252-
);
253-
254-
return row.replayId && replayTarget && replayExists(row[key]) ? (
255-
<AlignCenter>
256-
<Link to={replayTarget}>{getShortEventId(row.replayId)}</Link>
257-
</AlignCenter>
258-
) : (
259-
<AlignCenter>
260-
<NoValue>{t('(no value)')}</NoValue>
261-
</AlignCenter>
262-
);
263-
}
264-
if (key === 'profile.id') {
265-
if (!defined(project) || !defined(row['profile.id'])) {
266-
return (
267-
<AlignCenter>
268-
<NoValue>{t('(no value)')}</NoValue>
269-
</AlignCenter>
270-
);
271-
}
272-
const target = generateProfileFlamechartRoute({
273-
organization,
274-
projectSlug,
275-
profileId: String(row['profile.id']),
276-
});
277-
278-
return (
279-
<AlignCenter>
280-
<Link to={target}>{getShortEventId(row['profile.id'])}</Link>
281-
</AlignCenter>
282-
);
283-
}
284-
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
285-
return <AlignRight>{row[key]}</AlignRight>;
286-
};
287-
288175
const renderSpansBodyCell = (col: Column, row: SpanSampleRowWithScore) => {
289176
const {key} = col;
290177
if (key === 'score') {
@@ -319,11 +206,7 @@ export function PageOverviewWebVitalsDetailPanel({
319206
{
320207
replayId: row.replayId,
321208
id: '', // id doesn't actually matter here. Just to satisfy type.
322-
'transaction.duration':
323-
useEap || isInp || (isSpansWebVital && useSpansWebVitals)
324-
? row[SpanIndexedField.SPAN_SELF_TIME]
325-
: // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
326-
row['transaction.duration'],
209+
'transaction.duration': row[SpanIndexedField.SPAN_SELF_TIME],
327210
timestamp: row.timestamp,
328211
},
329212
undefined
@@ -381,13 +264,6 @@ export function PageOverviewWebVitalsDetailPanel({
381264
}
382265
return <NoOverflow>{NO_VALUE}</NoOverflow>;
383266
}
384-
if (key === SpanIndexedField.SPAN_DESCRIPTION) {
385-
return (
386-
<NoOverflow>
387-
<Tooltip title={row[key]}>{row[key]}</Tooltip>
388-
</NoOverflow>
389-
);
390-
}
391267
if (key === 'id') {
392268
const eventTarget =
393269
project?.slug &&
@@ -460,7 +336,7 @@ export function PageOverviewWebVitalsDetailPanel({
460336
renderBodyCell: renderSpansBodyCell,
461337
}}
462338
/>
463-
) : useEap || (isSpansWebVital && useSpansWebVitals) ? (
339+
) : (
464340
<GridEditable
465341
data={spansTableData}
466342
isLoading={isSpansLoading}
@@ -475,17 +351,6 @@ export function PageOverviewWebVitalsDetailPanel({
475351
renderBodyCell: renderSpansBodyCell,
476352
}}
477353
/>
478-
) : (
479-
<GridEditable
480-
data={transactionsTableData as any as TransactionSampleRowWithScore[]} // TODO: fix typing
481-
isLoading={isTransactionWebVitalsQueryLoading}
482-
columnOrder={PAGELOADS_COLUMN_ORDER}
483-
columnSortBy={[sort]}
484-
grid={{
485-
renderHeadCell,
486-
renderBodyCell,
487-
}}
488-
/>
489354
)}
490355
</TableContainer>
491356
<PageAlert />

static/app/views/insights/browser/webVitals/components/tables/pagePerformanceTable.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ describe('PagePerformanceTable', function () {
5555
'count_scores(measurements.score.inp)': 985,
5656
'count_scores(measurements.score.total)': 985,
5757
'performance_score(measurements.score.total)': 0.847767385770207,
58-
'total_opportunity_score()': 6.956683571915815e-5,
59-
'opportunity_score(measurements.score.total)': 179.76662400002692,
58+
'opportunity_score(measurements.score.total)': 0.0001,
6059
'p75(measurements.inp)': 144.0,
6160
'p75(measurements.ttfb)': 783.125,
6261
'p75(measurements.lcp)': 700.2999782562256,

static/app/views/insights/browser/webVitals/components/webVitalsDetailPanel.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('WebVitalsDetailPanel', function () {
7070
'count()',
7171
],
7272
query:
73-
'transaction.op:[pageload,""] span.op:[ui.interaction.click,ui.interaction.hover,ui.interaction.drag,ui.interaction.press,ui.webvital.cls,ui.webvital.lcp,""] !transaction:"<< unparameterized >>"',
73+
'span.op:[ui.interaction.click,ui.interaction.hover,ui.interaction.drag,ui.interaction.press,ui.webvital.cls,ui.webvital.lcp,pageload,""] !transaction:"<< unparameterized >>"',
7474
}),
7575
})
7676
);
@@ -103,7 +103,7 @@ describe('WebVitalsDetailPanel', function () {
103103
'sum(measurements.score.weight.lcp)',
104104
],
105105
query:
106-
'transaction.op:[pageload,""] span.op:[ui.interaction.click,ui.interaction.hover,ui.interaction.drag,ui.interaction.press,ui.webvital.cls,ui.webvital.lcp,""] !transaction:"<< unparameterized >>"',
106+
'span.op:[ui.interaction.click,ui.interaction.hover,ui.interaction.drag,ui.interaction.press,ui.webvital.cls,ui.webvital.lcp,pageload,""] !transaction:"<< unparameterized >>"',
107107
}),
108108
})
109109
);
@@ -133,10 +133,10 @@ describe('WebVitalsDetailPanel', function () {
133133
'count_scores(measurements.score.inp)',
134134
'count_scores(measurements.score.ttfb)',
135135
'count_scores(measurements.score.total)',
136-
'total_opportunity_score()',
136+
'opportunity_score(measurements.score.total)',
137137
],
138138
query:
139-
'transaction.op:[pageload,""] span.op:[ui.interaction.click,ui.interaction.hover,ui.interaction.drag,ui.interaction.press,ui.webvital.cls,ui.webvital.lcp,""] !transaction:"<< unparameterized >>" avg(measurements.score.total):>=0 count_scores(measurements.score.lcp):>0',
139+
'span.op:[ui.interaction.click,ui.interaction.hover,ui.interaction.drag,ui.interaction.press,ui.webvital.cls,ui.webvital.lcp,pageload,\"\"] !transaction:\"<< unparameterized >>\" avg(measurements.score.total):>=0 count_scores(measurements.score.lcp):>0',
140140
}),
141141
})
142142
);

static/app/views/insights/browser/webVitals/components/webVitalsDetailPanel.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import type {
3434
} from 'sentry/views/insights/browser/webVitals/types';
3535
import decodeBrowserTypes from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
3636
import {SampleDrawerBody} from 'sentry/views/insights/common/components/sampleDrawerBody';
37-
import {useInsightsEap} from 'sentry/views/insights/common/utils/useEap';
3837
import {useModuleURL} from 'sentry/views/insights/common/utils/useModuleURL';
3938
import {
4039
ModuleName,
@@ -65,8 +64,6 @@ export function WebVitalsDetailPanel({webVital}: {webVital: WebVitals | null}) {
6564
location.query[SpanIndexedField.USER_GEO_SUBREGION]
6665
) as SubregionCode[];
6766

68-
const useEap = useInsightsEap();
69-
7067
const {data: projectData} = useProjectRawWebVitalsQuery({browserTypes, subregions});
7168
const {data: projectScoresData} = useProjectWebVitalsScoresQuery({
7269
weightWebVital: webVital ?? 'total',
@@ -97,11 +94,8 @@ export function WebVitalsDetailPanel({webVital}: {webVital: WebVitals | null}) {
9794
if (!data) {
9895
return [];
9996
}
100-
const sumWeights = useEap
101-
? 1
102-
: webVital
103-
? projectScoresData?.[0]?.[`sum(measurements.score.weight.${webVital})`] || 0
104-
: 0;
97+
const sumWeights = 1;
98+
10599
return data
106100
.map(row => ({
107101
...row,
@@ -117,7 +111,7 @@ export function WebVitalsDetailPanel({webVital}: {webVital: WebVitals | null}) {
117111
return b.opportunity - a.opportunity;
118112
})
119113
.slice(0, MAX_ROWS);
120-
}, [data, projectScoresData, webVital, useEap]);
114+
}, [data]);
121115

122116
useEffect(() => {
123117
if (webVital !== null) {

static/app/views/insights/browser/webVitals/queries/rawWebVitalsQueries/useProjectRawWebVitalsQuery.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type {Tag} from 'sentry/types/group';
22
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
3+
import {DEFAULT_QUERY_FILTER} from 'sentry/views/insights/browser/webVitals/settings';
34
import type {BrowserType} from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
4-
import {useDefaultWebVitalsQuery} from 'sentry/views/insights/browser/webVitals/utils/useDefaultQuery';
55
import {useMetrics} from 'sentry/views/insights/common/queries/useDiscover';
66
import {SpanMetricsField, type SubregionCode} from 'sentry/views/insights/types';
77

@@ -19,7 +19,6 @@ export const useProjectRawWebVitalsQuery = ({
1919
subregions,
2020
}: Props = {}) => {
2121
const search = new MutableSearch([]);
22-
const defaultQuery = useDefaultWebVitalsQuery();
2322
if (transaction) {
2423
search.addFilterValue('transaction', transaction);
2524
}
@@ -35,7 +34,7 @@ export const useProjectRawWebVitalsQuery = ({
3534

3635
return useMetrics(
3736
{
38-
search: [defaultQuery, search.formatString()].join(' ').trim(),
37+
search: [DEFAULT_QUERY_FILTER, search.formatString()].join(' ').trim(),
3938
limit: 50,
4039
fields: [
4140
'p75(measurements.lcp)',

static/app/views/insights/browser/webVitals/queries/rawWebVitalsQueries/useProjectRawWebVitalsValuesTimeseriesQuery.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import {getInterval} from 'sentry/components/charts/utils';
22
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
33
import usePageFilters from 'sentry/utils/usePageFilters';
4+
import {DEFAULT_QUERY_FILTER} from 'sentry/views/insights/browser/webVitals/settings';
45
import type {BrowserType} from 'sentry/views/insights/browser/webVitals/utils/queryParameterDecoders/browserType';
5-
import {useDefaultWebVitalsQuery} from 'sentry/views/insights/browser/webVitals/utils/useDefaultQuery';
66
import {useMetricsSeries} from 'sentry/views/insights/common/queries/useDiscoverSeries';
7-
import {useInsightsEap} from 'sentry/views/insights/common/utils/useEap';
87
import {SpanIndexedField, type SubregionCode} from 'sentry/views/insights/types';
98

109
type Props = {
@@ -19,8 +18,6 @@ export const useProjectRawWebVitalsValuesTimeseriesQuery = ({
1918
subregions,
2019
}: Props) => {
2120
const pageFilters = usePageFilters();
22-
const defaultQuery = useDefaultWebVitalsQuery();
23-
const useEap = useInsightsEap();
2421
const search = new MutableSearch([]);
2522

2623
if (transaction) {
@@ -33,12 +30,10 @@ export const useProjectRawWebVitalsValuesTimeseriesQuery = ({
3330
search.addDisjunctionFilterValues(SpanIndexedField.USER_GEO_SUBREGION, subregions);
3431
}
3532

36-
const interval = useEap ? 'spans-low' : 'low';
37-
3833
const result = useMetricsSeries(
3934
{
40-
search: [defaultQuery, search.formatString()].join(' ').trim(),
41-
interval: getInterval(pageFilters.selection.datetime, interval),
35+
search: [DEFAULT_QUERY_FILTER, search.formatString()].join(' ').trim(),
36+
interval: getInterval(pageFilters.selection.datetime, 'spans-low'),
4237
yAxis: [
4338
'p75(measurements.lcp)',
4439
'p75(measurements.fcp)',

0 commit comments

Comments
 (0)