sentry-javascript
sentry-javascript copied to clipboard
feat(tracing): Add long task collection
fixes https://github.com/getsentry/sentry-javascript/issues/3807
Summary
This adds long task collection to represent long running ui behaviour as spans in your frontend transactions. Behind an unexposed option for now.
For context, we've been collecting long tasks in our main sentry UI now, and they can be quite helpful to determine where and when the ui is being blocked (and might hint where to add custom spans if a user chose to do so).
Screenshot
Example of us using it in Sentry already
On my review list for today
size-limit report 📦
Path | Size |
---|---|
@sentry/browser - ES5 CDN Bundle (gzipped + minified) | 19.39 KB (+0.03% 🔺) |
@sentry/browser - ES5 CDN Bundle (minified) | 59.99 KB (0%) |
@sentry/browser - ES6 CDN Bundle (gzipped + minified) | 17.96 KB (0%) |
@sentry/browser - ES6 CDN Bundle (minified) | 52.88 KB (0%) |
@sentry/browser - Webpack (gzipped + minified) | 19.73 KB (0%) |
@sentry/browser - Webpack (minified) | 64.21 KB (0%) |
@sentry/react - Webpack (gzipped + minified) | 19.75 KB (0%) |
@sentry/nextjs Client - Webpack (gzipped + minified) | 44.39 KB (+0.51% 🔺) |
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) | 25.89 KB (+0.4% 🔺) |
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) | 24.26 KB (+0.94% 🔺) |
Seems like a new experimental feature, but we may be able to use TaskAttributionTiming to get some contextual data for LongTasks, which we could attach as additional data on LongTask spans
The task attributions doesn't have good details IMO (spec: https://w3c.github.io/longtasks/#sec-TaskAttributionTiming), I don't know how much value we'll get by attaching it to the span.
Yeah you're right, that's unfortunate. I was hoping that we might be able to get some useful info from containerName
, but didn't realize the possible values were so limited