Using zone.js in otel is a bit risky and buggy #612
Labels
bug
Something isn't working
📦 Lexbox
issues related to any server side code, fw-headless included
OpenTelemetry
owner: Tim, Kevin
Milestone
Uh oh!
There was an error while loading. Please reload this page.
I finally understand this warning about using the
ZoneContextManager
for OTEL tracing in the browser:And I'm pretty sure it explains this issue that @rmunn was having:
I don't think we're currently having any "real" issues, like this one. We don't use
afterNavigate
, but there could be other affected hooks etc.Essentially,
ZoneContextManager
(or zone.js more specifically) doesn't support native Promises orasync
/await
syntax (because that syntax using native Promises). So, its tracking of asynchronous operations gets buggy in those scenarios. And then I guess weird things can happen.Here's the issue tracking zone.js' support of
async
/await
syntax. Essentially it sounds like it will never happen.Our options:
➕ we benefit from
ZoneContextManager
handling the async APIs that it can track/instrument➖ weird bugs could arise
back to ES2015outasync
/await
syntax using babel-plugin-transform-async-to-promises. Which is apparently how Angular solves it➕
ZoneContextManager
would be happy and we might even get better traces (e.g. this might actually end up in the context of a trace)➖ It's trickier to do this with Svelte than with other non-compiler based frameworks
➖ Transpiled code results in uglier/less readable stack traces
ZoneContextManager
➕ The risk is gone
➖ Some of our traces might fall apart
The text was updated successfully, but these errors were encountered: