Uh oh!
There was an error while loading. Please reload this page.
feat(sveltekit): Add partial instrumentation for client-side fetch - #7626
Conversation
fetchsize-limit report 📦
|
Uh oh!
There was an error while loading. Please reload this page.
51eca27 to
ab20d0bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ea8a521 to
df10ac4Compare| ...(urlObject.hash && { 'http.hash': urlObject.hash.substring(1) }), | ||
| }; | ||
| // TODO: extract this to a util function (and use it in breadcrumbs integration as well) |
There was a problem hiding this comment.
Will do this in a separate PR as this spans multiple packages
Uh oh!
There was an error while loading. Please reload this page.
| (host && | ||
| host | ||
| // Always filter out authority | ||
| .replace(/^.*@/, '[filtered]:[filtered]@') |
There was a problem hiding this comment.
This ain't pretty, I know... turns out finding a proper authority regex that isn't ReDos vulnerable is very hard. I think we can leave this as is for now and maybe revisit whenever we sanitize URLs everywhere on the browser side.
(I'd argue that this function should nevertheless be a good base we can reuse later on).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
7cafcd7 to
5f05517Compareproperly sanitize url, add url data apply data to breadcrumbs cleanup set span status add tests sorry fix authority url "fix" authority regex again cleanup move addTracingHeadersToFetchRequest back to tracing-internal cleanup apply suggestions re-activate request object test adjust types after exporting
b7ce245 to
0314949Compare
This PR adds partial instrumentation to the client-side
fetchpassed to the universalloadfunctions. It enables distributed traces of fetch calls happening inside aloadfunction.Limitation:
fetchrequests made by SvelteKit (e.g. to call server-only load functions) are not touched by this instrumentation because we cannot access the Kit-internal fetch function at this time. Opened an issue on the SvelteKit repo to find a solution for this.Anyway, here's a fancy screenshot of a successful trace:
My guess is that sveltejs/kit#9542 and sveltejs/kit#9530 are gonna take a little while longer to be resolved. I'd say, we add this in for the moment so that we at least get these traces connected. We should take it out/adjust whenever we have
handleLoadorhandleFetchavailable.ref: #7413