-
Notifications
You must be signed in to change notification settings - Fork 821
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 tracer, zone context manager and User Interaction plugin does not work with Angular #1206
Labels
bug
Something isn't working
Comments
I will investigate this soon and let you know, thx for raising the issue |
Thank you. Please let me know if you need more info or if I can help somehow. |
another fix is here |
and finally a contrib repo open-telemetry/opentelemetry-js-contrib#88 |
Thank you. I can confirm these patches fix the bug. |
pichlermarc
pushed a commit
to dynatrace-oss-contrib/opentelemetry-js
that referenced
this issue
Dec 15, 2023
removed wrong dataloader and mongoose entries from release-please manifest. sort entries in release-please config. Co-authored-by: Rauno Viskus <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
I'm using the following Otel packages:
Output of
npm ls
:Click to expand
What version of Node are you using?
What did you do?
If possible, provide a recipe for reproducing the error.
I checked out the Angular real world app (https://github.com/gothinkster/angular-realworld-example-app) and tried to instrument it with the web tracer, zone context manager and user interaction plugin.
Changes I made to
src/main.ts
:What did you expect to see?
Expected the app to run normally, generate spans and print them to console.
What did you see instead?
App generates some spans but crashes as soon as a blog post is clicked and navigation is triggered.
Additional context
As soon as I click a blog post, the app crashes with the following error from Angular in console:
The UI breaks as well and looks like this:
It looks like Angular does not like it when we patch
runTask
and pass it a Zone.js zone instead of an NgZone here: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/plugins/web/opentelemetry-plugin-user-interaction/src/userInteraction.ts#L324The following patch silences the error:
It looks like we either need to work with the original zone objects and add/duplicate context to them or accept a Zone implementation using some sort of dependency injection mechanism. This can allow all the plugins and the zone context manager to use whatever implementation of Zone is used by the app.
Another option is to have a special
angular-context-manager
that specifically uses NgZone, and then have all the plugins work with whatever kind of zone object is used by the context.I've not used Angular, NgZone or Zone.js before so may be I'm doing something horribly wrong.
The text was updated successfully, but these errors were encountered: