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

Web browser plugin for XHRs #493

Closed
draffensperger opened this issue Nov 6, 2019 · 1 comment · Fixed by #595
Closed

Web browser plugin for XHRs #493

draffensperger opened this issue Nov 6, 2019 · 1 comment · Fixed by #595
Assignees
Milestone

Comments

@draffensperger
Copy link
Contributor

What would you think about creating a web browser plugin that instruments XHRs?

Here are a couple things we did in OpenCensus Web related to that:

  • The XHR tracing was related to the user interaction tracing in the sense that XHR spans would be children of automatic user-interaction traces. This was nice because there would be a root span that would be something like Save.click and there would be child spans of the HTTP requests it triggered. We could handle this in OpenTelemetry by just making the XHR spans be children of the current span or otherwise root spans (maybe that's just the default thing we do anyway!).
  • We actually combined data from both monkey-patching XMLHttpRequest, and from using the Resource Timing API, see this doc, and code links (perf-resource-timing-selector.ts and xhr-interceptor.ts). This enabled richer spans that included network-related time events similar to the initial page load resource spans, but also allowed information about the eventual HTTP status code.
  • It's important to propagate trace headers to the server, but we need a way for the user to configure this on a per-domain basis, because it may have implicates around CORS to send the extra header (hopefully that will eventually change once traceparent is in the browser spec, but that's a way off). In OpenCensus Web, we had a regex of origins that should be matched to end trace headers.

@obecny WDYT?

@obecny
Copy link
Member

obecny commented Nov 6, 2019

pls assign this to me, thx

@mayurkale22 mayurkale22 added this to the Alpha v0.4 milestone Nov 26, 2019
@obecny obecny mentioned this issue Dec 5, 2019
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants