You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(profiling): stale ProfilingContext cache causing missing trace endpoint labels (#7786)
TracingPlugin.startSpan() calls storage.enterWith({span}) immediately on span
creation, before the plugin calls addRequestTags() to set span.type='web'. The
first enterCh event therefore fires with span.type unset, causing
#getProfilingContext to compute webTags=undefined and cache that result on the
span. When the span is re-activated moments later (with span.type='web' already
set) the stale cache is returned and webTags stays undefined for the entire
request, so no trace endpoint labels appear in the CPU profile.
Fix: skip writing the cache when endpointCollectionEnabled is true, webTags is
undefined, *and* the span's type is not yet set. On the next activation the
context is recomputed; once span.type='web' is known webTags is found and the
result is cached normally.
This affects both the ACF path (pprof.time.setContext per activation) and the
non-ACF path (_currentContext.ref mutation), so the fix lives in
#getProfilingContext which is shared by both.
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
0 commit comments