Skip to content

fix(dart): Add span v2 envelope metadata#3700

Draft
buenaflor wants to merge 1 commit into
mainfrom
buenaflor/feat/span-first-ingest-esttings
Draft

fix(dart): Add span v2 envelope metadata#3700
buenaflor wants to merge 1 commit into
mainfrom
buenaflor/feat/span-first-ingest-esttings

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

📜 Description

Add the span v2 envelope item container metadata required by Relay for pre-encoded span batches.

Span v2 envelope item payloads now include version: 2 and ingest_settings with automatic IP and user-agent inference, while logs and metrics continue to use the plain items container.

💡 Motivation and Context

Fixes #3690.

The span v2 envelope item payload contract requires top-level version and ingest_settings fields in addition to the items array. Without these fields, span v2 batches do not fully match the expected ingest payload shape.

💚 How did you test it?

  • fvm dart format lib/src/sentry_envelope.dart test/sentry_envelope_test.dart
  • fvm dart analyze lib/src/sentry_envelope.dart test/sentry_envelope_test.dart
  • fvm dart test test/sentry_envelope_test.dart
  • Pre-commit hooks ran staged Dart formatting and package analyze successfully.

📝 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

Made with Cursor

Include the span v2 payload version and automatic ingest settings when
building pre-encoded span envelope items.

Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

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


Fixes

  • (dart) Add span v2 envelope metadata by buenaflor in #3700

🤖 This preview updates automatically when you update the PR.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.85%. Comparing base (87fcdd8) to head (1f3cd4a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3700      +/-   ##
==========================================
- Coverage   86.96%   86.85%   -0.12%     
==========================================
  Files         335      335              
  Lines       11976    11988      +12     
==========================================
- Hits        10415    10412       -3     
- Misses       1561     1576      +15     
Flag Coverage Δ
sentry 86.76% <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.15% <ø> (-0.38%) ⬇️
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.

@github-actions
Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1259.40 ms 1261.11 ms 1.72 ms
Size 5.73 MiB 6.18 MiB 463.86 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
1adf565 1264.51 ms 1265.22 ms 0.71 ms
d789735 1240.58 ms 1246.41 ms 5.82 ms
2f63d89 1251.67 ms 1263.94 ms 12.27 ms
cdf371b 1246.24 ms 1251.10 ms 4.86 ms
fd88186 1255.06 ms 1252.76 ms -2.30 ms
ce5c42b 1246.06 ms 1251.91 ms 5.85 ms
e5ae2a6 1240.48 ms 1253.26 ms 12.78 ms
944b773 1252.82 ms 1254.08 ms 1.27 ms
73dca78 1246.65 ms 1265.42 ms 18.76 ms
7cfbbd6 1270.63 ms 1285.36 ms 14.72 ms

App size

Revision Plain With Sentry Diff
1adf565 5.66 MiB 6.10 MiB 451.33 KiB
d789735 5.53 MiB 5.96 MiB 443.28 KiB
2f63d89 5.65 MiB 6.09 MiB 446.25 KiB
cdf371b 5.53 MiB 6.02 MiB 501.23 KiB
fd88186 5.53 MiB 6.00 MiB 479.94 KiB
ce5c42b 5.73 MiB 6.17 MiB 455.86 KiB
e5ae2a6 5.65 MiB 6.09 MiB 446.96 KiB
944b773 5.53 MiB 6.00 MiB 479.98 KiB
73dca78 7.86 MiB 9.44 MiB 1.58 MiB
7cfbbd6 7.86 MiB 9.44 MiB 1.58 MiB

@github-actions
Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 374.18 ms 352.76 ms -21.42 ms
Size 14.31 MiB 15.56 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
bfabaf2 408.04 ms 444.38 ms 36.34 ms
fec56a1 370.66 ms 369.28 ms -1.38 ms
8541716 437.14 ms 443.65 ms 6.51 ms
0fb45d0 482.79 ms 554.02 ms 71.23 ms
0fb3800 465.64 ms 536.77 ms 71.13 ms
e04b24b 504.72 ms 516.43 ms 11.71 ms
944b773 470.54 ms 480.18 ms 9.64 ms
cdf371b 367.64 ms 377.02 ms 9.38 ms
0bea8d9 389.45 ms 394.96 ms 5.50 ms
5b9a0da 446.94 ms 449.22 ms 2.28 ms

App size

Revision Plain With Sentry Diff
bfabaf2 13.93 MiB 15.06 MiB 1.13 MiB
fec56a1 14.31 MiB 15.49 MiB 1.19 MiB
8541716 13.93 MiB 15.00 MiB 1.06 MiB
0fb45d0 6.54 MiB 7.70 MiB 1.17 MiB
0fb3800 6.54 MiB 7.69 MiB 1.15 MiB
e04b24b 13.93 MiB 15.00 MiB 1.06 MiB
944b773 13.93 MiB 15.00 MiB 1.06 MiB
cdf371b 13.93 MiB 15.18 MiB 1.25 MiB
0bea8d9 14.31 MiB 15.56 MiB 1.25 MiB
5b9a0da 13.93 MiB 14.93 MiB 1.00 MiB

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.

Span V2 envelope container should have ingest_settings

1 participant