Skip to content

Commit 98e8774

Browse files
Lms24s1gr1d
andauthored
feat(browser): Record standalone LCP spans (#16591)
This PR implements sending standalone LCP spans as an opt-in feature. Behaviour-wise, it's mostly aligned with our prior implementation of sending CLS standalone spans (#13056): - add an `_experiments.enableStandaloneLcpSpans` option and treat it as opt-in - keep collecting LCP values until users soft-navigate or the page is hidden - then, send the LCP span once - adds all `lcp.*` span attributes as well as the `lcp` measurement to the span (depending on if we merge #16589 or this first, we might need to readjust size limit) closes #13063 --------- Co-authored-by: s1gr1d <sigrid.huemer@posteo.at> Co-authored-by: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com>
1 parent 56c9fcb commit 98e8774

File tree

9 files changed

+566
-17
lines changed

9 files changed

+566
-17
lines changed

.size-limit.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ module.exports = [
3838
path: 'packages/browser/build/npm/esm/index.js',
3939
import: createImport('init', 'browserTracingIntegration'),
4040
gzip: true,
41-
limit: '39 KB',
41+
limit: '40 KB',
4242
},
4343
{
4444
name: '@sentry/browser (incl. Tracing, Replay)',
4545
path: 'packages/browser/build/npm/esm/index.js',
4646
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
4747
gzip: true,
48-
limit: '77 KB',
48+
limit: '80 KB',
4949
},
5050
{
5151
name: '@sentry/browser (incl. Tracing, Replay) - with treeshaking flags',
5252
path: 'packages/browser/build/npm/esm/index.js',
5353
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
5454
gzip: true,
55-
limit: '70.1 KB',
55+
limit: '75 KB',
5656
modifyWebpackConfig: function (config) {
5757
const webpack = require('webpack');
5858

@@ -156,7 +156,7 @@ module.exports = [
156156
name: 'CDN Bundle (incl. Tracing)',
157157
path: createCDNPath('bundle.tracing.min.js'),
158158
gzip: true,
159-
limit: '39 KB',
159+
limit: '41 KB',
160160
},
161161
{
162162
name: 'CDN Bundle (incl. Tracing, Replay)',
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
integrations: [
8+
Sentry.browserTracingIntegration({
9+
idleTimeout: 9000,
10+
_experiments: {
11+
enableStandaloneLcpSpans: true,
12+
},
13+
}),
14+
],
15+
tracesSampleRate: 1,
16+
debug: true,
17+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<div id="content"></div>
8+
<img src="https://sentry-test-site.example/my/image.png" />
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)