sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

feat(tracing): Add long task collection

Open k-fish opened this issue 2 years ago • 5 comments

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

163429297-517a84f3-4229-4ea2-9fd0-3b93c6c76414

k-fish avatar Aug 05 '22 15:08 k-fish

200

On my review list for today

AbhiPrasad avatar Aug 05 '22 15:08 AbhiPrasad

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% 🔺)

github-actions[bot] avatar Aug 05 '22 19:08 github-actions[bot]

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

0Calories avatar Aug 09 '22 16:08 0Calories

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.

AbhiPrasad avatar Aug 09 '22 16:08 AbhiPrasad

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

0Calories avatar Aug 09 '22 17:08 0Calories