Skip to content

Tag navigation spans as cold (first after launch) vs warm (subsequent) #6336

Description

@antonis

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.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions