Skip to content

feat(span-first): Add transaction and app start type span attributes#3678

Merged
buenaflor merged 4 commits into
mainfrom
buenaflor/feat/app-start-v2-span-attrs
May 4, 2026
Merged

feat(span-first): Add transaction and app start type span attributes#3678
buenaflor merged 4 commits into
mainfrom
buenaflor/feat/app-start-v2-span-attrs

Conversation

@buenaflor

@buenaflor buenaflor commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Add streaming span attributes for Sentry transaction/segment naming and app start classification.

Streaming spans now include the deprecated sentry.transaction attribute alongside sentry.segment.name, both populated from the local segment name. V2 native app-start child spans also receive app.vitals.start.type so each app-start span carries its cold/warm classification.

sentry.transaction is needed for the mobile vitals page to work correctly

💡 Motivation and Context

This keeps span streaming payloads compatible with consumers that still look for the transaction attribute while also exposing app-start type on every app-start child span, not only the top-level app-start span.

💚 How did you test it?

  • fvm dart test test/telemetry/span/span_capture_pipeline_test.dart
  • fvm flutter test test/integrations/native_app_start_handler_v2_test.dart
  • fvm dart analyze lib/src/constants.dart lib/src/telemetry/span/span_capture_pipeline.dart test/telemetry/span/span_capture_pipeline_test.dart
  • fvm flutter analyze lib/src/integrations/native_app_start_handler_v2.dart test/integrations/native_app_start_handler_v2_test.dart
  • Pre-commit formatting and package analyze checks

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

N/A

Made with Cursor

buenaflor and others added 2 commits April 29, 2026 13:59
Add transaction and app start type attributes to streaming spans so
span payloads carry the segment name and app start classification.

Co-Authored-By: GPT-5.5 <[email protected]>
Made-with: Cursor
Keep the segment metadata test self-contained while still covering child
span transaction attributes.

Co-Authored-By: GPT-5.5 <[email protected]>
Made-with: Cursor
Copilot AI review requested due to automatic review settings April 30, 2026 10:23
@buenaflor
buenaflor requested a review from denrase as a code owner April 30, 2026 10:23
@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

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).


Features

  • (span-first) Add transaction and app start type span attributes by buenaflor in #3678

Fixes

  • (flutter) Send frame delay in seconds by buenaflor in #3677

Dependencies

Deps

  • chore(deps): update Native SDK to v0.13.8 by github-actions in #3667
  • chore(deps): update Android SDK to v8.40.0 by github-actions in #3663

Internal Changes

Deps

  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.25.4 to 2.26.2 by dependabot in #3671
  • Bump getsentry/craft from 2.25.2 to 2.26.2 by dependabot in #3672
  • Bump actions/upload-artifact from 7.0.0 to 7.0.1 by dependabot in #3653

Other

  • Enforce conventional commit format for PR titles by buenaflor in #3666

🤖 This preview updates automatically when you update the PR.

@buenaflor buenaflor changed the title feat: Add streaming span attributes feat(span-first): Add streaming span attributes Apr 30, 2026
@codecov

codecov Bot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.90%. Comparing base (bb17c57) to head (711d5da).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3678   +/-   ##
=======================================
  Coverage   86.90%   86.90%           
=======================================
  Files         335      335           
  Lines       11935    11935           
=======================================
  Hits        10372    10372           
  Misses       1563     1563           
Flag Coverage Δ
sentry 86.66% <100.00%> (+<0.01%) ⬆️
sentry_dio 97.73% <ø> (ø)
sentry_drift 93.57% <ø> (ø)
sentry_file 65.29% <ø> (ø)
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 91.51% <100.00%> (-0.01%) ⬇️
sentry_hive 77.48% <ø> (ø)
sentry_isar 74.37% <ø> (ø)
sentry_link 21.50% <ø> (ø)
sentry_logging 97.01% <ø> (ø)
sentry_sqflite 88.81% <ø> (ø)
sentry_supabase 97.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@buenaflor buenaflor changed the title feat(span-first): Add streaming span attributes feat: Add transaction and app start type span attributes Apr 30, 2026
@buenaflor buenaflor changed the title feat: Add transaction and app start type span attributes feat(span-first): Add transaction and app start type span attributes Apr 30, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d59a89b. Configure here.

Comment thread packages/flutter/lib/src/integrations/native_app_start_handler_v2.dart Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional attributes to streamed spans to keep downstream consumers compatible with deprecated naming and to consistently classify native app-start child spans.

Changes:

  • Add deprecated sentry.transaction attribute (mirroring sentry.segment.name) to captured/streamed spans.
  • Add app.vitals.start.type attribute to all V2 native app-start spans via shared attributes.
  • Extend tests to validate these new attributes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/flutter/lib/src/integrations/native_app_start_handler_v2.dart Adds app.vitals.start.type into the shared attributes applied to all native app-start spans.
packages/flutter/test/integrations/native_app_start_handler_v2_test.dart Adds a test asserting app-start child spans carry the start type attribute.
packages/dart/lib/src/telemetry/span/span_capture_pipeline.dart Adds sentry.transaction alongside sentry.segment.name during span capture.
packages/dart/test/telemetry/span/span_capture_pipeline_test.dart Updates test span setup and asserts sentry.transaction is populated correctly.
packages/dart/lib/src/constants.dart Introduces SemanticAttributesConstants.sentryTransaction constant and docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/dart/lib/src/constants.dart Outdated
Comment thread packages/flutter/test/integrations/native_app_start_handler_v2_test.dart Outdated
Rely on the shared app start attributes map to set the type once for all
app start spans.

Co-Authored-By: GPT-5.5 <[email protected]>
Made-with: Cursor
@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 415.27 ms 416.29 ms 1.01 ms
Size 14.31 MiB 15.56 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c97f488 502.43 ms 492.47 ms -9.97 ms
3801d52 397.53 ms 378.87 ms -18.66 ms
0929dbf 462.82 ms 492.76 ms 29.94 ms
426fbfd 368.10 ms 353.23 ms -14.87 ms
0e2b9b0 368.00 ms 356.72 ms -11.28 ms
cf443d2 464.64 ms 479.04 ms 14.40 ms
396cb30 405.70 ms 427.56 ms 21.86 ms
ce5c42b 401.52 ms 394.63 ms -6.90 ms
c8596a6 474.00 ms 492.96 ms 18.96 ms
2d34233 470.54 ms 558.90 ms 88.36 ms

App size

Revision Plain With Sentry Diff
c97f488 14.31 MiB 15.49 MiB 1.19 MiB
3801d52 14.31 MiB 15.49 MiB 1.19 MiB
0929dbf 6.54 MiB 7.70 MiB 1.17 MiB
426fbfd 13.93 MiB 15.06 MiB 1.13 MiB
0e2b9b0 14.30 MiB 15.49 MiB 1.19 MiB
cf443d2 13.93 MiB 15.00 MiB 1.06 MiB
396cb30 13.93 MiB 15.06 MiB 1.13 MiB
ce5c42b 14.31 MiB 15.49 MiB 1.19 MiB
c8596a6 6.54 MiB 7.53 MiB 1015.27 KiB
2d34233 6.54 MiB 7.55 MiB 1.01 MiB

Previous results on branch: buenaflor/feat/app-start-v2-span-attrs

Startup times

Revision Plain With Sentry Diff
d59a89b 443.42 ms 433.60 ms -9.82 ms
541bde9 395.10 ms 401.98 ms 6.88 ms
629f9ba 369.58 ms 353.87 ms -15.71 ms

App size

Revision Plain With Sentry Diff
d59a89b 14.31 MiB 15.56 MiB 1.25 MiB
541bde9 14.31 MiB 15.56 MiB 1.25 MiB
629f9ba 14.31 MiB 15.56 MiB 1.25 MiB

@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1258.24 ms 1268.29 ms 10.05 ms
Size 5.73 MiB 6.18 MiB 463.71 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
1fff351 1265.77 ms 1256.06 ms -9.70 ms
d2356d0 1257.04 ms 1257.94 ms 0.89 ms
c002f00 1252.47 ms 1258.78 ms 6.31 ms
cf443d2 1255.79 ms 1248.38 ms -7.40 ms
3f47ea3 1263.90 ms 1263.87 ms -0.02 ms
1ce780b 1252.49 ms 1256.17 ms 3.68 ms
0929dbf 1275.89 ms 1282.22 ms 6.33 ms
6b69699 1254.80 ms 1273.31 ms 18.52 ms
a10aff4 1241.67 ms 1255.02 ms 13.35 ms
fd88186 1255.06 ms 1252.76 ms -2.30 ms

App size

Revision Plain With Sentry Diff
1fff351 5.73 MiB 6.17 MiB 455.43 KiB
d2356d0 5.66 MiB 6.09 MiB 448.38 KiB
c002f00 5.65 MiB 6.09 MiB 448.38 KiB
cf443d2 5.53 MiB 6.00 MiB 479.99 KiB
3f47ea3 5.53 MiB 5.96 MiB 444.81 KiB
1ce780b 5.66 MiB 6.10 MiB 451.58 KiB
0929dbf 7.86 MiB 9.54 MiB 1.69 MiB
6b69699 7.86 MiB 9.44 MiB 1.58 MiB
a10aff4 5.53 MiB 6.00 MiB 486.71 KiB
fd88186 5.53 MiB 6.00 MiB 479.94 KiB

Previous results on branch: buenaflor/feat/app-start-v2-span-attrs

Startup times

Revision Plain With Sentry Diff
541bde9 1254.16 ms 1267.35 ms 13.18 ms
d59a89b 1253.36 ms 1254.13 ms 0.77 ms
629f9ba 1242.61 ms 1243.07 ms 0.46 ms

App size

Revision Plain With Sentry Diff
541bde9 5.73 MiB 6.18 MiB 463.71 KiB
d59a89b 5.73 MiB 6.18 MiB 463.71 KiB
629f9ba 5.73 MiB 6.18 MiB 463.70 KiB

Assert that the top-level app start span also receives the shared app
start type attribute.

Co-Authored-By: GPT-5.5 <[email protected]>
Made-with: Cursor
@getsentry getsentry deleted a comment from sentry Bot Apr 30, 2026

@denrase denrase left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment regarding the deprecation.

static const sentrySegmentName = 'sentry.segment.name';

/// The Sentry transaction name, also known as the segment name.
/// This is deprecated in favor of [sentrySegmentName].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a @Deprecated annotation here instead? Might get lost if it's just in the comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not adding it because I don't wanna get flagged by the linter that we're using deprecated variables

@buenaflor
buenaflor merged commit 75cbd63 into main May 4, 2026
150 of 151 checks passed
@buenaflor
buenaflor deleted the buenaflor/feat/app-start-v2-span-attrs branch May 4, 2026 12:46
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.

3 participants