Skip to content

feat(attributes): Add sentry.segment.op and app.start_phase - #842

Open
alwx wants to merge 1 commit into
mainfrom
alwx/feature/react-native-long-task-attributes
Open

alwx wants to merge 1 commit into
mainfrom
alwx/feature/react-native-long-task-attributes

Conversation

@alwx

@alwx alwx commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Description

The React Native SDK sends the react_native.long_task.duration metric. getsentry/sentry-react-native#7119 adds attributes that tell where each long task happened. Two of them have no key yet, so this PR proposes:

  • sentry.segment.op: the op of the segment (root span) that was active when the data was recorded. It sits next to sentry.segment.name. sentry.op does not fit a metric, because there it reads as the op of the metric itself.
  • app.start_phase: app_start or steady_state. app.vitals.start.type does not fit, because it describes a cold or warm start.

The PR also defines the react_native.long_task.duration metric with its attributes. The metric shipped in 8.34.0 without a definition.

Open question: for the screen, the SDK uses the existing router.navigation.route.id with the route name. OpenTelemetry has app.screen.name, which is moving to the client-side semantic conventions repository and is not there yet. Do you prefer app.screen.name for mobile screens?

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

If an attribute was added:

  • The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • I have used the correct value for apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

The React Native SDK reports react_native.long_task.duration and wants to break it down by the screen, the foreground state, the app start phase and the segment. Two of these values have no key yet.

sentry.segment.op holds the op of the segment (root span) that was active when the data was recorded. It sits next to sentry.segment.name. sentry.op does not fit a metric, because it describes the op of the item itself.

app.start_phase tells whether the data was recorded before or after the app start ended, with the values app_start and steady_state. app.vitals.start.type does not fit, because it describes a cold or warm start.

The commit also defines the react_native.long_task.duration metric with its attributes, which shipped without a definition.
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-conventions Ready Ready Preview Dec 1, 2026 10:49am UTC

Request Review

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add sentry.segment.op and app.start_phase by alwx in #842
  • Add missing log severity attributes by srothh in #831
  • Add WebSocket span name convention by chargome and claude in #836

🤖 This preview updates automatically when you update the PR.

This branch was successfully deployed

1 active deployment
Preview — f684fae8 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant