Skip to content

Commit 275e15d

Browse files
msonnbclaude
andauthored
feat(browser)!: Use browser.paint span op for paint entries (#22673)
Rename the raw `paint` op to the registered `browser.paint` for `first-paint` and `first-contentful-paint` spans. Part of #22446 --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3191118 commit 275e15d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

  • dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fp-fcp
  • packages/browser-utils/src/metrics

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fp-fcp/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestUrl, pa
1818
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];
1919

2020
expect(fpSpan).toBeDefined();
21-
expect(fpSpan?.op).toBe('paint');
21+
expect(fpSpan?.op).toBe('browser.paint');
2222
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
2323
});
2424

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

3838
expect(fcpSpan).toBeDefined();
39-
expect(fcpSpan?.op).toBe('paint');
39+
expect(fcpSpan?.op).toBe('browser.paint');
4040
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
4141
});

packages/browser-utils/src/metrics/browserMetrics.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import { getActivationStart } from './web-vitals/lib/getActivationStart';
2626
import { getNavigationEntry } from './web-vitals/lib/getNavigationEntry';
2727
import { getVisibilityWatcher } from './web-vitals/lib/getVisibilityWatcher';
2828
import { DEBUG_BUILD } from '../debug-build';
29-
import { URL_FULL } from '@sentry/conventions/attributes';
29+
import { SENTRY_OP, URL_FULL } from '@sentry/conventions/attributes';
30+
import { BROWSER_BROWSER_PAINT_SPAN_OP } from '@sentry/conventions/op';
3031
interface NavigatorNetworkInformation {
3132
readonly connection?: NetworkInformation;
3233
}
@@ -483,8 +484,8 @@ function _addPaintSpan(
483484

484485
startAndEndSpan(span, startTimestamp, startTimestamp + duration, {
485486
name: entry.name,
486-
op: entry.entryType,
487487
attributes: {
488+
[SENTRY_OP]: BROWSER_BROWSER_PAINT_SPAN_OP,
488489
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',
489490
},
490491
});

0 commit comments

Comments
 (0)