Skip to content

Commit 5d368f6

Browse files
logaretmclaude
andcommitted
feat(browser)!: Extract web vitals into dedicated webVitalsIntegration
Moves LCP, CLS and INP tracking out of `browserTracingIntegration` into a new standalone `webVitalsIntegration`. `browserTracingIntegration` auto-registers it (in `afterAllSetup`) when the user hasn't supplied one, so default behavior is preserved. Also removes the v1 standalone span envelope path entirely: - `trackLcpAsStandaloneSpan`, `trackClsAsStandaloneSpan`, `startTrackingINP` and `_onInp` are gone from `@sentry-internal/browser-utils` - `startStandaloneWebVitalSpan` is deleted (no remaining callers) - `SentrySpan#_isStandaloneSpan`, `SentrySpan#isStandaloneSpan()` and the standalone send branch in `_onSpanEnded` are removed - `createSpanEnvelope` and the local `sendSpanEnvelope` helper are deleted - `SpanContext.isStandalone` and `StartSpanOptions.experimental.standalone` are removed from the public types - `enableInp` option on `browserTracingIntegration` is removed (migrate to `webVitalsIntegration({ disable: ['inp'] })`) - `_experiments.enableStandaloneClsSpans` and `_experiments.enableStandaloneLcpSpans` are removed Streamed spans are unaffected: they use `createStreamedSpanEnvelope`, `SpanBuffer`, and the `afterSegmentSpanEnd` hook, all of which are intact. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 9956476 commit 5d368f6

44 files changed

Lines changed: 135 additions & 2656 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
## Unreleased
44

5-
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
5+
- **feat(browser)!: Extract Web Vitals into a dedicated `webVitalsIntegration` (v11)**
6+
7+
Web vital tracking (LCP, CLS, INP) has been extracted out of `browserTracingIntegration` into a new standalone `webVitalsIntegration`. `browserTracingIntegration` auto-registers it by default, so no migration is required for the common case.
8+
9+
Breaking changes:
10+
- `enableInp` option on `browserTracingIntegration` has been removed. To disable INP, register `webVitalsIntegration({ disable: ['inp'] })` alongside `browserTracingIntegration`.
11+
- `_experiments.enableStandaloneClsSpans` and `_experiments.enableStandaloneLcpSpans` have been removed; the v1 standalone web vital span path no longer exists.
12+
- The internal standalone span envelope path (`SpanContext.isStandalone`, `experimental.standalone` on `StartSpanOptions`, `createSpanEnvelope`, `SentrySpan#isStandaloneSpan`) has been removed. Web vitals now flow through the v2 streamed span pipeline exclusively.
613

714
## 10.51.0
815

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/linked-traces-streamed/consistent-sampling/tracesSampler-precedence/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [
8+
Sentry.webVitalsIntegration({ disable: ['inp'] }),
89
Sentry.browserTracingIntegration({
910
linkPreviousTrace: 'in-memory',
1011
consistentTraceSampling: true,
11-
enableInp: false,
1212
}),
1313
Sentry.spanStreamingIntegration(),
1414
],

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/linked-traces/consistent-sampling/tracesSampler-precedence/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [
8+
Sentry.webVitalsIntegration({ disable: ['inp'] }),
89
Sentry.browserTracingIntegration({
910
linkPreviousTrace: 'in-memory',
1011
consistentTraceSampling: true,
11-
enableInp: false,
1212
}),
1313
],
1414
tracePropagationTargets: ['sentry-test-external.io'],

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-animation-frame-before-navigation-streamed/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [
8+
Sentry.webVitalsIntegration({ disable: ['inp'] }),
89
Sentry.browserTracingIntegration({
910
enableLongTask: false,
1011
enableLongAnimationFrame: true,
1112
instrumentPageLoad: false,
12-
enableInp: false,
1313
}),
1414
Sentry.spanStreamingIntegration(),
1515
],

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-animation-frame-before-navigation/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [
8+
Sentry.webVitalsIntegration({ disable: ['inp'] }),
89
Sentry.browserTracingIntegration({
910
enableLongTask: false,
1011
enableLongAnimationFrame: true,
1112
instrumentPageLoad: false,
12-
enableInp: false,
1313
}),
1414
],
1515
tracesSampleRate: 1,

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-before-navigation-streamed/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [
8+
Sentry.webVitalsIntegration({ disable: ['inp'] }),
89
Sentry.browserTracingIntegration({
910
enableLongAnimationFrame: false,
1011
instrumentPageLoad: false,
1112
instrumentNavigation: true,
12-
enableInp: false,
1313
enableLongTask: true,
1414
}),
1515
Sentry.spanStreamingIntegration(),

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-before-navigation/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [
8+
Sentry.webVitalsIntegration({ disable: ['inp'] }),
89
Sentry.browserTracingIntegration({
910
enableLongAnimationFrame: false,
1011
instrumentPageLoad: false,
1112
instrumentNavigation: true,
12-
enableInp: false,
1313
enableLongTask: true,
1414
}),
1515
],

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-cls-standalone-spans/init.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-cls-standalone-spans/subject.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-cls-standalone-spans/template.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)