Skip to content

Commit 7a70629

Browse files
fix(insights): Fix user and replay columns not displaying properly in Webvitals EAP (#91572)
Fixes and issue where user and replay columns on the EAP dataset in Webvitals wasn't displaying properly. This is because there no longer exists a field that coalesces on multiple `user.*` columns in the api, so we handle this in the frontend by querying all user columns and coalesce ourselves. Same for replay ids.
1 parent d15e0e0 commit 7a70629

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

static/app/views/insights/browser/webVitals/queries/useSpanSamplesWebVitalsQuery.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,12 @@ export function useSpanSamplesWebVitalsQuery({
104104
SpanIndexedField.TOTAL_SCORE,
105105
SpanIndexedField.TRACE,
106106
SpanIndexedField.PROFILE_ID,
107-
SpanIndexedField.REPLAY,
108-
SpanIndexedField.USER_DISPLAY,
107+
SpanIndexedField.REPLAY_ID,
108+
SpanIndexedField.REPLAYID,
109+
SpanIndexedField.USER_EMAIL,
110+
SpanIndexedField.USER_USERNAME,
111+
SpanIndexedField.USER_ID,
112+
SpanIndexedField.USER_IP,
109113
SpanIndexedField.PROJECT,
110114
SpanIndexedField.SPAN_DESCRIPTION,
111115
SpanIndexedField.TIMESTAMP,
@@ -126,8 +130,12 @@ export function useSpanSamplesWebVitalsQuery({
126130
return {
127131
...row,
128132
[`measurements.${webVital}`]: row[ratioField] > 0 ? row[field] : undefined,
129-
'user.display': row[SpanIndexedField.USER_DISPLAY],
130-
replayId: row[SpanIndexedField.REPLAY],
133+
'user.display':
134+
row[SpanIndexedField.USER_EMAIL] ??
135+
row[SpanIndexedField.USER_USERNAME] ??
136+
row[SpanIndexedField.USER_ID] ??
137+
row[SpanIndexedField.USER_IP],
138+
replayId: row[SpanIndexedField.REPLAY_ID] ?? row[SpanIndexedField.REPLAYID],
131139
'profile.id': row[SpanIndexedField.PROFILE_ID],
132140
totalScore: Math.round((row[`measurements.score.total`] ?? 0) * 100),
133141
inpScore: Math.round((row[SpanIndexedField.INP_SCORE_RATIO] ?? 0) * 100),

static/app/views/insights/browser/webVitals/views/pageOverview.spec.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ describe('PageOverview', function () {
146146
'measurements.score.total',
147147
'trace',
148148
'profile_id',
149-
'replay',
150-
'user.display',
149+
'replay.id',
150+
'replayId',
151+
'user.email',
152+
'user.username',
153+
'user.id',
154+
'user.ip',
151155
'project',
152156
'span.description',
153157
'timestamp',
@@ -197,8 +201,12 @@ describe('PageOverview', function () {
197201
'measurements.score.total',
198202
'trace',
199203
'profile_id',
200-
'replay',
201-
'user.display',
204+
'replay.id',
205+
'replayId',
206+
'user.email',
207+
'user.username',
208+
'user.id',
209+
'user.ip',
202210
'project',
203211
'span.description',
204212
'timestamp',

static/app/views/insights/types.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ export enum SpanIndexedField {
340340
RELEASE = 'release',
341341
TRANSACTION = 'transaction',
342342
ORIGIN_TRANSACTION = 'origin.transaction',
343+
REPLAYID = 'replayId',
343344
REPLAY_ID = 'replay.id',
344345
REPLAY = 'replay', // Field alias that coalesces `replay.id` and `replayId`
345346
BROWSER_NAME = 'browser.name',
@@ -434,6 +435,7 @@ export type SpanIndexedResponse = {
434435
[SpanIndexedField.HTTP_RESPONSE_CONTENT_LENGTH]: string;
435436
[SpanIndexedField.ORIGIN_TRANSACTION]: string;
436437
[SpanIndexedField.REPLAY_ID]: string;
438+
[SpanIndexedField.REPLAYID]: string;
437439
[SpanIndexedField.REPLAY]: string;
438440
[SpanIndexedField.BROWSER_NAME]: string;
439441
[SpanIndexedField.USER]: string;

0 commit comments

Comments
 (0)