Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tracing): Track PerformanceResourceTiming.renderBlockingStatus #7127

Merged
merged 2 commits into from Feb 13, 2023

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Feb 9, 2023

As per https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus the resource timing has information about whether an asset is blocking render or not, which is useful for determining which assets need to be addressed for fixing critical path.

As per https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus the resource timing has information about whether an asset is blocking render or not, which is useful for determining which assets need to be addressed for fixing critical path.
@k-fish k-fish requested review from a team, lforst and AbhiPrasad and removed request for a team February 9, 2023 17:38
k-fish added a commit to getsentry/develop that referenced this pull request Feb 9, 2023
Adds mention of new data on resource spans, see getsentry/sentry-javascript#7127
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.07 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 62.2 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.7 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.34 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.43 KB (0%)
@sentry/browser - Webpack (minified) 66.78 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.46 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.88 KB (+0.07% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.02 KB (+0.15% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.28 KB (+0.15% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.27 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 36.7 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 59.97 KB (+0.07% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.49 KB (+0.01% 🔺)

@@ -361,6 +362,9 @@ export function _addResourceSpans(
if ('decodedBodySize' in entry) {
data['Decoded Body Size'] = entry.decodedBodySize;
}
if ('renderBlockingStatus' in entry) {
data['Render Blocking Status'] = entry.renderBlockingStatus;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, I would like our data fields to move toward being similar to otel span attributes in formatting, lowercase and snake case, with period separators similar to span operation.

Can we use resource.render_blocking_status instead here?

see trace semantic conventions: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/README.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually going to mention this, it was wild there are spaces etc. Very in 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah not ideal we have Decoded Body Size, maybe we can change this too though? I kept it as is for backwards compat sake, but if we can update the detectors we can change it here as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to look at changing these existing fields, we'd have to have both for a while (maybe 30d), are we fine with that?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Replay SDK metrics 🚀

    Plain +Sentry +Replay
Revision Value Value Diff Ratio Value Diff Ratio
LCP This PR 7e57cb7 74.43 ms 95.51 ms +21.08 ms +28.32 % 122.32 ms +47.89 ms +64.34 %
Previous 538c3a6 67.84 ms 95.01 ms +27.17 ms +40.04 % 131.47 ms +63.63 ms +93.78 %
CLS This PR 7e57cb7 0.06 ms 0.06 ms -0.00 ms -0.03 % 0.06 ms +0.00 ms +0.05 %
Previous 538c3a6 0.06 ms 0.06 ms +0.00 ms +0.02 % 0.06 ms +0.00 ms +0.07 %
CPU This PR 7e57cb7 17.56 % 17.02 % -0.53 pp -3.04 % 28.15 % +10.59 pp +60.33 %
Previous 538c3a6 12.41 % 13.75 % +1.34 pp +10.81 % 26.55 % +14.14 pp +113.94 %
JS heap avg This PR 7e57cb7 1.93 MB 2.08 MB +144.88 kB +7.49 % 3.03 MB +1.09 MB +56.56 %
Previous 538c3a6 1.94 MB 2 MB +57.01 kB +2.94 % 3.01 MB +1.07 MB +55.46 %
JS heap max This PR 7e57cb7 2.32 MB 2.59 MB +275.35 kB +11.88 % 4.53 MB +2.21 MB +95.29 %
Previous 538c3a6 2.3 MB 2.57 MB +265.36 kB +11.52 % 4.47 MB +2.16 MB +93.94 %
netTx This PR 7e57cb7 0 B 0 B 0 B n/a 2.59 kB +2.59 kB n/a
Previous 538c3a6 0 B 0 B 0 B n/a 2.6 kB +2.6 kB n/a
netRx This PR 7e57cb7 0 B 0 B 0 B n/a 41 B +41 B n/a
Previous 538c3a6 0 B 0 B 0 B n/a 41 B +41 B n/a
netCount This PR 7e57cb7 0 0 0 n/a 1 +1 n/a
Previous 538c3a6 0 0 0 n/a 1 +1 n/a
netTime This PR 7e57cb7 0.00 ms 0.00 ms 0.00 ms n/a 72.93 ms +72.93 ms n/a
Previous 538c3a6 0.00 ms 0.00 ms 0.00 ms n/a 112.08 ms +112.08 ms n/a

Previous results on branch: develop

RevisionLCPCLSCPUJS heap avgJS heap maxnetTxnetRxnetCountnetTime
538c3a6+63.63 ms+0.00 ms+14.14 pp+1.07 MB+2.16 MB+2.6 kB+41 B+1+112.08 ms
fc7b716+52.44 ms+0.00 ms+14.74 pp+1.09 MB+2.21 MB+2.68 kB+41 B+1+89.64 ms

*) pp - percentage points - an absolute difference between two percentages.
Last updated: Thu, 09 Feb 2023 20:39:45 GMT

@AbhiPrasad AbhiPrasad added this to the Performance Issues milestone Feb 10, 2023
@@ -77,6 +77,7 @@ export function Transaction(obj?: Partial<Event>): any {
'Transfer Size': 1097,
'Encoded Body Size': 797,
'Decoded Body Size': 1885,
'resource.render_blocking_status': 'non-blocking',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more bikeshed convo :p

Right now the blocked_main_thread span data key is set in the mobile sdks, to get File I/O perf issues working.

Could we re-use that? I'm fine with not - this works with me as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear you want to re-use the same key? I don't know about that, I'd prefer more closely matching the vendor implementation we're scraping from otherwise there will be work in the product to constantly explain the differences, vs. letting these keys be self-evident

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup makes sense, let's keep this unique to browser!

@AbhiPrasad AbhiPrasad changed the title ref(perf): Add renderBlockingStatus feat(tracing): Track resource renderBlockingStatus Feb 10, 2023
@AbhiPrasad AbhiPrasad changed the title feat(tracing): Track resource renderBlockingStatus feat(tracing): Track resource render_blocking_status Feb 13, 2023
@AbhiPrasad AbhiPrasad changed the title feat(tracing): Track resource render_blocking_status feat(tracing): Track PerformanceResourceTiming.renderBlockingStatus Feb 13, 2023
@k-fish k-fish merged commit a961e57 into develop Feb 13, 2023
@k-fish k-fish deleted the ref/perf-add-render-blocking-status branch February 13, 2023 20:14
k-fish added a commit to getsentry/develop that referenced this pull request Feb 13, 2023
* docs(sdk): Update render blocking status.

Adds mention of new data on resource spans, see getsentry/sentry-javascript#7127
AbhiPrasad pushed a commit that referenced this pull request Feb 14, 2023
…#7127)

* ref(perf): Add renderBlockingStatus

As per https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus the resource timing has information about whether an asset is blocking render or not, which is useful for determining which assets need to be addressed for fixing critical path.
ramchaik pushed a commit to ramchaik/sentry-javascript that referenced this pull request Feb 14, 2023
…getsentry#7127)

* ref(perf): Add renderBlockingStatus

As per https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus the resource timing has information about whether an asset is blocking render or not, which is useful for determining which assets need to be addressed for fixing critical path.
mjq-sentry added a commit to getsentry/sentry that referenced this pull request Feb 22, 2023
…44981)

As of browser SDK 7.38.0, we now [log the render-blocking
status](getsentry/sentry-javascript#7127)
reported by the browser in resource spans' `data` hash. (Background
info:
[MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus)).
If a value is present and that span is `non-blocking`, ignore our
heuristics and treat the resource as non-blocking in the Large Render
Blocking Asset detector.

This commit also updates each test case to start from a valid event and then
minimally mutate it into an invalid one, because I was losing confidence
that each test was really testing what it should.
Sign up for free to 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.

None yet

2 participants