-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conflict with New Relic SDK causing expensive DOM I/O for "fetch" #6177
Comments
This is tricky, because we require the I/O to make sure we are grabbing onto the correct instance of fetch. Important to note we heavily recommend initializing Sentry as soon as possible (before any other application code/instrumentation). One thing we can probably do is make the transport initialization more lazy - but we probably will not backport these changes to v6, so you'll have to upgrade to v7 to take advantage of them. Do you have any ideas on your end? For now, you can avoid this by using the XHR transport we offer, which should prevent the fetch functionality.
|
@AbhiPrasad Thanks for the wicked fast reply! Y'all are great 😄
Definitely noted! The challenge here is that most observability vendors have a recommendation that they run first to capture intrinsics like
That's very reasonable - definitely don't expect y'all to backport any work. We recently attempted to upgrade to the 7.x releases, but there were some things breaking with one of our 3rd party vendors' code. We're still working through this, but understand we'd need to move to 7.x for any fixes to the fetch issue.
We'll give this a shot! If the native
Can you help me understand the technical requirement that the Sentry SDK has access to the native fetch, vs a wrapped copy? Just trying to understand if the wrapping here is to capture |
I'm going to make some benchmarks to sanity check the DOM I/O, but generally that change should be good to go.
We do this because of: sentry-javascript/packages/browser/src/transports/utils.ts Lines 10 to 38 in bfe819d
This should be fine afaik, but please let us know if there are issues, we can take a look!
If (when?) you ever get around to the v7 upgrade again, please feel free to open a GitHub issue with the error you're encountering, we are more than happy to help y'all debug through it! |
@AbhiPrasad this is super helpful context, thank you! The reasoning makes sense to me. We've got a ticket to switch over to the XHR transport, and I'll report back if that addresses the issue (assume it will tho). Final question: Is it worth Sentry considering making the |
We thought thought about the opposite actually - #5927. Having the fetch |
I was able to confirm that switching to the XHR transport did prevent the blocking IO for the transport setup, but it appears that the blocking is still happening in the |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/react
SDK Version
6.9.18
Framework Version
17.0.2
Link to Sentry event
No response
Steps to Reproduce
window.fetch
with a new functionBrowserBackend.prototype._setupTransport
Expected Result
No style recalculations in the DOM
Actual Result
This testing was done on a Moto G Power using the latest version of Chrome.
It looks like the wrapped copy of fetch fails the
isNativeFetch
check, which leads to the slow path with the iframe injection. TheisNativeFetch
function looks to have been added originally to avoid the cost of iframe injectionThe text was updated successfully, but these errors were encountered: