Skip to content

feat(replay): Capture fetch body size for replay events - #7524

Merged
mydea merged 4 commits into
developfrom
fn/replay-bundle-size
Mar 22, 2023
Merged

feat(replay): Capture fetch body size for replay events#7524
mydea merged 4 commits into
developfrom
fn/replay-bundle-size

Conversation

@mydea

Copy link
Copy Markdown
Member

This adjusts the replay request body capturing to capture the fetch body size if no Content-Length header is present.

@mydea
mydea requested a review from billyvgMarch 20, 2023 13:11
@mydeamydea self-assigned this Mar 20, 2023
@github-actions

github-actionsBot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@sentry/browser - ES5 CDN Bundle (gzipped + minified)20.44 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified)63.52 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified)19.13 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified)56.57 KB (0%)
@sentry/browser - Webpack (gzipped + minified)21.59 KB (0%)
@sentry/browser - Webpack (minified)71.65 KB (0%)
@sentry/react - Webpack (gzipped + minified)21.61 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified)51.85 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)27.77 KB (0%)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)26.08 KB (0%)
@sentry/replay ES6 CDN Bundle (gzipped + minified)44.3 KB (+0.2% 🔺)
@sentry/replay - Webpack (gzipped + minified)38.36 KB (+0.21% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)62.49 KB (+0.15% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified)56.03 KB (+0.16% 🔺)

@billyvg

billyvg commented Mar 20, 2023

Copy link
Copy Markdown
Member

Tested this on my local Sentry and it works - though I do want to note that the sizes are slightly off from the browser which shows the size over the network (which I assume is smaller due to compression). Thoughts on the best way to inform users on the UI here since we display the "resource size" that is on the tooltip vs "transferred over the network".

image

Comment threadpackages/replay/src/coreHandlers/handleNetworkBreadcrumbs.ts
@mydea

Copy link
Copy Markdown
MemberAuthor

Tested this on my local Sentry and it works - though I do want to note that the sizes are slightly off from the browser which shows the size over the network (which I assume is smaller due to compression). Thoughts on the best way to inform users on the UI here since we display the "resource size" that is on the tooltip vs "transferred over the network".

image

It may also differ because I guess the network tab includes header etc. data into the size, maybe? But even if not it could def. be slightly different, hard to say how exactly that is calculated..!

@mydea
mydeaforce-pushed the fn/replay-bundle-size branch 3 times, most recently from 9bcd880 to 45b1660CompareMarch 22, 2023 11:33
@mydea
mydeaforce-pushed the fn/replay-bundle-size branch from 45b1660 to a34ab79CompareMarch 22, 2023 15:18
@mydea
mydea merged commit 21dd20d into developMar 22, 2023
@mydea
mydea deleted the fn/replay-bundle-size branch March 22, 2023 15:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mydea@billyvg