Replies: 1 comment
-
|
@cindy-m there's no browser-compatible
your best options: 1. import { context, trace } from '@opentelemetry/api';
const span = tracer.startSpan('my-op');
const ctx = trace.setSpan(context.active(), span);
await context.with(ctx, async () => {
// context.active() returns ctx here
await fetch('/api/data');
});this is what #1502 recommends. worth noting: even 2. keep zone.js loaded solely for otel. angular 19's zoneless mode means angular ignores zone.js for change detection, but zone.js can still coexist as a side-effect import. downside: ~100KB bundle overhead for a library you're trying to remove. 3. wait for TC39 AsyncContext (stage 2). this would give browsers native also see your own #6211 which tracks this gap. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Good day to everyone,
sinds not so long ago, we added opentelemetry to our app (which is currently using Angular 19) to be able to trace everything. The COntextmanager we are currently using is the ZoneContextManager because we have async calls. However. our application is zoneless actually and we want to get it zoneless again. Is there any ContextManager alternatives that we can use? Or does someone know how to get it trace async and zoneless as ZoneOCntextManager depends heavily on zone.js. Also created the issue for this here: #6211
unfortunately, there was no reaction on this issue till now, only that we are not the only one with this problem.
As Angular updates, they are stepping away from zone, so it is necessary to keep it zoneless
Beta Was this translation helpful? Give feedback.
All reactions