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
{{ message }}
Repository navigation
Improve ignoreSpans behaviour in Browser SDKs #17451
The initial implementation of ignoreSpans retroactively, at event processing time, removes spans matching the filter criteria from the trace and re-parents existing spans. While this works reasonably well in server SDKs, where the root span always has a defined start and end point, it doesn't work well in browser sdks.
This is because the root spans created from our browser SDKs (pageload and navigation spans) are almost exclusively idle spans, meaning they have a defined start point but their end point is debounced until no more child spans are added (with a couple of timeout options to keep things at bay of course).
This leads to the problem that if we filter out spans via ignoreSpans that initially prolonged the pageload (et al.) root span, the root span appears way longer in duration than the remaining child spans. This effectively makes the root span duration even more unactionable than it is already.
Short-term, we have 2 possibilities to improve this:
Apply ignoreSpans prior to starting any span. This would be logical but is only possible in browser-land. Meaning, the behaviour of this option would significantly differ between browser and Node/OTel-based SDKs.
Apply another round of idle span end timestamp adjustment at at post-event-processing time. We already adjust the end time of the idle span to the longest running child span but we'd need to do another pass of this adjustment after applying ignoreSpans where we currently do it.
I'm kinda leaning towards 1 for now, mainly because we can but equally unhappy to go with either option.
Activity
linear commentedon Aug 25, 2025
JS-881 Improve `ignoreSpans` behaviour in Browser SDKs
mydea commentedon Aug 29, 2025
I think the main reason why applying this at start time may not work well is that span attributes may not be fully finalized at this point 🤔
cleptric commentedon Sep 2, 2025
I think this is ok, a limitation we can document.
fix(browser): Ensure idle span duration is adjusted when child spans …
github-actions commentedon Sep 22, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #17700, which was included in the 10.13.0 release.