Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Deps
Samples
Other
🤖 This preview updates automatically when you update the PR. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7660 +/- ##
=============================================
+ Coverage 85.307% 85.347% +0.039%
=============================================
Files 485 486 +1
Lines 28838 28903 +65
Branches 12523 12551 +28
=============================================
+ Hits 24601 24668 +67
+ Misses 4190 4187 -3
- Partials 47 48 +1
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b0c71c8 | 1206.29 ms | 1242.13 ms | 35.84 ms |
| e701dc8 | 1215.89 ms | 1254.06 ms | 38.17 ms |
| 88592c1 | 1221.80 ms | 1259.98 ms | 38.18 ms |
| 1b74fd4 | 1219.43 ms | 1250.17 ms | 30.73 ms |
| 6108e4c | 1212.31 ms | 1251.80 ms | 39.49 ms |
| 56c05ae | 1218.02 ms | 1253.30 ms | 35.28 ms |
| 19f3e6b | 1231.17 ms | 1257.02 ms | 25.85 ms |
| 2d1826b | 1216.96 ms | 1254.05 ms | 37.09 ms |
| d68691e | 1221.48 ms | 1248.13 ms | 26.65 ms |
| c424b6a | 1220.38 ms | 1248.18 ms | 27.80 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b0c71c8 | 24.14 KiB | 1.08 MiB | 1.06 MiB |
| e701dc8 | 24.14 KiB | 1.06 MiB | 1.04 MiB |
| 88592c1 | 24.14 KiB | 1.12 MiB | 1.10 MiB |
| 1b74fd4 | 24.14 KiB | 1.10 MiB | 1.08 MiB |
| 6108e4c | 24.14 KiB | 1.11 MiB | 1.09 MiB |
| 56c05ae | 24.14 KiB | 1.10 MiB | 1.08 MiB |
| 19f3e6b | 24.14 KiB | 1.10 MiB | 1.08 MiB |
| 2d1826b | 24.14 KiB | 1.12 MiB | 1.09 MiB |
| d68691e | 24.14 KiB | 1.12 MiB | 1.09 MiB |
| c424b6a | 24.14 KiB | 1.06 MiB | 1.04 MiB |
philipphofmann
left a comment
There was a problem hiding this comment.
Review for Claude Code.
.../SentryTests/Integrations/Performance/AppStartTracking/AppStartMeasurementHandlerTests.swift
Outdated
Show resolved
Hide resolved
.../SentryTests/Integrations/Performance/AppStartTracking/AppStartMeasurementHandlerTests.swift
Outdated
Show resolved
Hide resolved
Sentry Build Distribution
|
Sentry Build Distribution
|
Sentry Build Distribution
|
Sentry Build Distribution
|
…vider Move the app start measurement retrieval logic from SentryTracer into a standalone SentryAppStartMeasurementProvider class to decouple it from the tracer and prepare for a future Swift rewrite. Agent transcript: https://claudescope.sentry.dev/share/-ySeYAQr0t_-TzVJYh7grS4nvSpo6f1NKAIEUc4__60
Call SentryAppStartMeasurementProvider.reset() directly from ClearTestState and the provider tests instead of routing through SentryTracer's forwarding method. Agent transcript: https://claudescope.sentry.dev/share/L1InLC1w4Xm6HgEp2bHk-sJ2wtr9fRfQ08BpwGE4JSs
Remove unused profilerReferenceID parameter, add header docs, and fix stale TSan suppression. Agent transcript: https://claudescope.sentry.dev/share/YCbJaiw4eo47tyRGdPdNfyWa3VZueptJtPoevH1S97A
Fix trailing closure ambiguity with DispatchWorkItem and remove non-existent profilerReferenceID parameter. Agent transcript: https://claudescope.sentry.dev/share/boilLz21_S-f8uu_dcXvext-dAi2MAY8xkbK2zEafW4
Add experimental option to send standalone app start transactions instead of attaching app start data to the first UIViewController transaction. Uses a strategy pattern via AppStartMeasurementHandler protocol. The standalone handler is currently a no-op placeholder; actual transaction logic will be added in a follow-up. Refs: #6883 Agent transcript: https://claudescope.sentry.dev/share/KZR39vRrsVDqgpm56ONILZFlu1u_gpBhAnK7QrpyOH0
Create a real tracer with app.start.cold/warm operation that reuses the existing tracer pipeline for span building, measurements, context, debug images, and profiling. - Add SentrySpanOperationAppStartCold/Warm constants - Relax getAppStartMeasurement to accept app start ops - Skip intermediate root span for standalone transactions - Enable option in iOS sample app for validation Refs: #6883 Agent transcript: https://claudescope.sentry.dev/share/UaCuhStnxjQCwKH46hOsPqgeHsckPh15A0Flqw8JOPc
Move the standalone app start detection from SentryBuildAppStartSpans to SentryTracer and pass it as a BOOL parameter. Use span operation constants instead of string literals. Agent transcript: https://claudescope.sentry.dev/share/QyuEyImC81GP83tCrqUbp939ejQ3-3y_0TcwnvcejsA
Deduplicate the app start operation check in SentryTracer into a single method reused in toTransaction and getAppStartMeasurement. Agent transcript: https://claudescope.sentry.dev/share/bffTUQ5TAcp6oTyLqR8SSSjLLG4pSUsZ8l7TB7qaq1s
Also verify the trace origin is auto.app_start to more precisely identify standalone app start transactions. Agent transcript: https://claudescope.sentry.dev/share/HhoCIcB8Nh0dEd16RtFdllS_ZIxK393KCEPaOUiPp5s
Add StandaloneAppStartTransactionHelper to centralize the logic for identifying standalone app start transactions next to the code that creates them. Agent transcript: https://claudescope.sentry.dev/share/th338Y1YxxM5471m3BNGV5Az6QKNTNQzAyhCyZ9MmuM
Avoids race conditions with global static by passing the measurement directly to the tracer. Agent transcript: https://claudescope.sentry.dev/share/5dFraoe7qfSofcTRtjfi59JzjPmHtWPyBK9YLzp61_g
- Move public functions to top of SentryBuildAppStartSpans.m - Expand SentryTracer comment on race condition avoidance - Use string literals instead of constants in tests - Assert specific debug image properties in test - Add span tree examples to header doc comments Agent transcript: https://claudescope.sentry.dev/share/4RQyqJ6qxJ3uLrCpOW-w1LjUpmtGerVFCS6DIZgKRXE
The platform guards for app start cleanup in clearTestState were missing os(visionOS), causing appStartMeasurementRead to never reset between tests on visionOS. This made tests that depend on app start measurement data fail when run after other tests that consume the measurement. Agent transcript: https://claudescope.sentry.dev/share/XRVuiHsfZrr_PPrwGDvT9RkHPcp6AxGP1tIDaq2H4CU
5378661 to
027eef2
Compare
📜 Description
Send app start data as a standalone transaction instead of attaching it to the first UIViewController transaction. The measurement is passed directly via
SentryTracerConfiguration, avoiding the global static and its race conditions.Based on #7655.
Fixes #6883.
💡 Motivation and Context
The current approach stores the app start measurement in a global static that gets consumed by the first
ui.loadtransaction. This is fragile — the measurement can be lost or consumed by the wrong transaction. A standalone transaction gives us full control over timing and avoids race conditions.💚 How did you test it?
markAsReadprevents double consumptionoptions.experimental.enableStandaloneAppStartTracing = trueenableStandaloneAppStartTracing = falseon this branch and compared againstmain. Both produce identical transaction structure: 26 spans, same operations, same hierarchy (Cold Startgrouping span with 5 child phase spans under theui.loadtransaction). No regression.Regression test details
Method
regression-testscope tag to identify each runsearch_events+get_trace_details)Results
regression-test-feature-branchregression-test-main-branch3ff1c4e3c3754ab18ece26d7e0cf722a3edc353029d34c9292f5ea85df4851acCold Start+ 5 phases)Cold Start+ 5 phases)ui.loadui.loadFull span comparison (sorted by duration desc)
ui.loadui.load.initial_displayui.load.full_displayapp.start.coldapp.start.coldhttp.clientapp.start.coldapp.start.coldapp.start.coldui.loadapp.start.coldfile.readfile.readfile.readfile.writefile.readui.loadfile.readui.loadui.loadui.loadui.loadui.loadui.loadui.loadui.loadSentry links
Reproducible prompt
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.