-
Notifications
You must be signed in to change notification settings - Fork 805
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
fix(sdk-trace-web): make parseUrl respect document.baseURI #3670
fix(sdk-trace-web): make parseUrl respect document.baseURI #3670
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3670 +/- ##
=======================================
Coverage 93.71% 93.71%
=======================================
Files 277 277
Lines 8454 8455 +1
Branches 1761 1762 +1
=======================================
+ Hits 7923 7924 +1
Misses 531 531
|
Looks like you have a lint failure. Please also make a changelog entry to |
703e628
to
f813b6c
Compare
Thanks @dyladan ! Updated changelog. Lint failure seems to be 503 to npmjs.com when linting docs, but the same link works now and lint passes locally. Likely a temporary issue at the time |
Please do not force push during the review process. It makes it more difficult to see what has changed since the last review, breaks comments on previous commits, and breaks links to previous commits. |
Which problem is this PR solving?
Noticed that fetch instrumentation breaks web apps that provide relative urls to
window.fetch
and have URL base explicitly set via a base element. The root cause seems to beparseUrl
, which resolves absolute URL usinglocation.href
as URL base when it should use document.baseURI.Short description of the changes
Makes
parseUrl
usedocument.baseURI
when available and fall back tolocation.href
when not (web workers).Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I'm attempting to instrument Grafana frontend with tracing. If fetch instrumentation is enabled, dashboards do not load due to mangled API request URLs. Applying this fix resolves the issue.
Checklist: