Navigation spans currently have no attribute distinguishing the first route after app launch from subsequent navigations. Adding a navigation.temperature attribute (cold vs warm) would enable per-route cold/warm performance breakdown in dashboards.
Implementation
In reactnavigation.ts, updateLatestNavigationSpanWithCurrentRoute(), initialFinalizedNavSpan already tracks the first navigation span that completed a state change. Before it gets set (~line 681), its absence indicates the first (cold) navigation:
span.setAttribute('navigation.temperature', !initialFinalizedNavSpan ? 'cold' : 'warm');
Add alongside existing attributes at ~line 694-705.
Notes
- "Cold" means "first navigation after the React Navigation container registered", which closely correlates with app cold start but is not identical (e.g. Android activity restart via
isAppRestart re-initializes things).
route.has_been_seen attribute already exists but tracks whether a specific route name was seen before — different from cold/warm which is about position in the session.
- Novel pattern — no cross-SDK precedent. Attribute name should be chosen carefully for potential future adoption by other SDKs.
Scope
JS only. ~3 lines of code + tests.
Navigation spans currently have no attribute distinguishing the first route after app launch from subsequent navigations. Adding a
navigation.temperatureattribute (coldvswarm) would enable per-route cold/warm performance breakdown in dashboards.Implementation
In
reactnavigation.ts,updateLatestNavigationSpanWithCurrentRoute(),initialFinalizedNavSpanalready tracks the first navigation span that completed a state change. Before it gets set (~line 681), its absence indicates the first (cold) navigation:Add alongside existing attributes at ~line 694-705.
Notes
isAppRestartre-initializes things).route.has_been_seenattribute already exists but tracks whether a specific route name was seen before — different from cold/warm which is about position in the session.Scope
JS only. ~3 lines of code + tests.