Skip to content

Add screen, app-state and span context to long task metric #7074

In review

Description

@antonis

longTaskIntegration (#6986, shipped in 8.34.0) emits react_native.long_task.duration with only sentry.origin, so long tasks cannot be broken down by where they happened.

  • Core already adds trace_id/span_id, and MobileReplay adds replay_id via processMetric. Both are read when the observer callback fires, after the task ends, and the metric timestamp is emit time (metrics.distribution takes no timestamp). With buffered: true, tasks from before init get init-time context.
  • The current route is already tracked in reactNativeTracingIntegration state.currentRoute (feeds contexts.app.view_names), but it is not on the metric.
  • No app-start vs steady-state or AppState signal.

Proposal (team discussion): add low-cardinality attributes: route name, app start vs steady state + AppState, active span op and root span name (not the leaf span name, to keep cardinality low).

Raised by Chris Aigner from customer feedback (CRO-917). Related: #6185.

Action taken by Junior.

Activity

  1. linear-code commented on Nov 20, 2026

    @linear-code
  2. self-assigned this
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions