Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestUrl, pa
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.op).toBe('browser.paint');
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

Expand All @@ -36,6 +36,6 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestUrl, page }) => {
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.op).toBe('browser.paint');
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
3 changes: 2 additions & 1 deletion packages/browser-utils/src/metrics/browserMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { getNavigationEntry } from './web-vitals/lib/getNavigationEntry';
import { getVisibilityWatcher } from './web-vitals/lib/getVisibilityWatcher';
import { DEBUG_BUILD } from '../debug-build';
import { URL_FULL } from '@sentry/conventions/attributes';
import { BROWSER_BROWSER_PAINT_SPAN_OP } from '@sentry/conventions/op';
interface NavigatorNetworkInformation {
readonly connection?: NetworkInformation;
}
Expand Down Expand Up @@ -561,7 +562,7 @@ export function _addMeasureSpans(
if (measureStartTimestamp <= measureEndTimestamp) {
startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, {
name: entry.name,
op: entry.entryType,
op: entry.entryType === 'paint' ? BROWSER_BROWSER_PAINT_SPAN_OP : entry.entryType,
attributes,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ describe('_addMeasureSpans', () => {
expect.objectContaining({ description: 'measure-pass', op: 'measure' }),
expect.objectContaining({ description: 'mark-pass', op: 'mark' }),
// name matches but type is not (mark|measure) => should not be ignored
expect.objectContaining({ description: 'mark-ignore', op: 'paint' }),
expect.objectContaining({ description: 'mark-ignore', op: 'browser.paint' }),
]),
);
});
Expand Down
Loading