-
Notifications
You must be signed in to change notification settings - Fork 237
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
[BUG] No auto dependency tracking when application insights is initialized and running on web worker #1483
Comments
Correct, a web worker is a self contained javascript instance and do not share the same XMLHttpRequest / fetch references. If you want to track dependency calls from both the main thread and any worker(s) then all instances would need to be instrumented. In your case as you are offloading the initialization into a worker, you would need to wrap and track the dependency calls (same as the dependency plugin) and then delegate the request (trackDependencyData) call to your worker. |
If i just delegate the XMLHttpRequest/Fetch calls to my worker and my worker makes the call (not sure if that is the right pattern), won't the dependency calls be tracked automatically, as worker has application insights initialized? Do i need to wrap and track the dependency calls separately as such? |
You could, but I wouldn't as you would incur additional marshalling costs for every request.
Yes, they should as long as you have also enabled fetch tracking (currently disabled by default), but as above I don't believe this would be the best approach -- it does of course depend on your application and performance requirements etc.
There are really 2 general approaches (or 3 based on your delegation pattern), so for the 2
|
Closing as this doesn't seem to an issue that we can address directly in the SDK (as a bug/enhancement) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
So have offloaded the app insights initialization and logging to a web worker. And we invoke the required methods from web worker to log to application insights. But it seems as the dependency calls are taking place on main thread and worker is unaware of this, dependency calls are not getting tracker. Is there any resolution to this issue?
The text was updated successfully, but these errors were encountered: