Skip to content

docs(flutter): Add standalone app start tracing docs - #18903

Merged
buenaflor merged 9 commits into
masterfrom
buenaflor/docs/flutter-standalone-app-start
Aug 3, 2026
Merged

docs(flutter): Add standalone app start tracing docs#18903
buenaflor merged 9 commits into
masterfrom
buenaflor/docs/flutter-standalone-app-start

Conversation

@buenaflor

@buenaflor buenaflor commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Documents standalone app start tracing for the Flutter SDK, shipped in 9.26.0 via getsentry/sentry-dart#3896 and getsentry/sentry-dart#3918.

By default the SDK attaches app start data to the first ui.load transaction, which mixes startup timing with screen-display timing. The new experimental enableStandaloneAppStartTracing option reports the app start as its own app.start transaction instead, so it no longer depends on a screen transaction being started and can be sampled independently.

Follows how Android (#18667) and Apple (#17852, #17920) documented the same feature, adjusted for the fact that Flutter keeps app start on its own integration page rather than in automatic-instrumentation.mdx.

Changes:

  • includes/dart-integrations/app-start-instrumentation.mdx — new Standalone App Start Tracing section covering the option, the Android/iOS-only limitation, and using tracesSampler to give app starts a dedicated sample rate. Plus an Extending the App Start subsection for SentryFlutter.extendAppStart() / finishExtendedAppStart(), including the try/finally pattern and the 30-second deadline caveat.
  • docs/platforms/dart/guides/flutter/tracing/index.mdx — short experimental-flagged section linking to the detail page, mirroring #17891.
  • docs/platforms/dart/guides/flutter/configuration/options.mdxenableStandaloneAppStartTracing entry under Tracing Options.

IS YOUR CHANGE URGENT?

  • None: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

EXTRA RESOURCES

Made with Cursor

App start data is attached to the first ui.load transaction by default, which
mixes startup timing with screen-display timing. Document the experimental
enableStandaloneAppStartTracing option that reports the app start as its own
app.start transaction, along with extendAppStart and finishExtendedAppStart for
covering startup work that runs past the first frame.

Shipped in sentry-dart 9.26.0.

Refs getsentry/sentry-dart#3896
Refs getsentry/sentry-dart#3918

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview Aug 3, 2026 12:09pm
sentry-docs Ready Ready Preview Aug 3, 2026 12:09pm

Request Review

The only requirement for extendAppStart is that it runs before the first frame
renders, so the root widget's initState works as well as appRunner. Show both as
tabs and note that the call has to come before the first await, since awaiting
first lets the frame render and the extension is refused.

Co-authored-by: Cursor <cursoragent@cursor.com>
@buenaflor
buenaflor marked this pull request as ready for review August 3, 2026 11:24
Copilot AI review requested due to automatic review settings August 3, 2026 11:24
Comment thread includes/dart-integrations/app-start-instrumentation.mdx 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

Documents the Flutter SDK’s experimental standalone app start tracing (enableStandaloneAppStartTracing) and the related “extend app start” APIs, aligning Flutter’s docs with existing Android/Apple coverage while keeping the detailed explanation on the integration page.

Changes:

  • Added a new “Standalone App Start Tracing” section (plus “Extending the App Start”) to the Flutter app start instrumentation integration docs.
  • Added a short experimental standalone app start tracing section to the Flutter tracing landing page, linking to the integration docs for details.
  • Added enableStandaloneAppStartTracing to the Flutter configuration options reference under Tracing Options.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
includes/dart-integrations/app-start-instrumentation.mdx Adds standalone app start tracing docs, sampling guidance, and extended app start API usage.
docs/platforms/dart/guides/flutter/tracing/index.mdx Adds a brief experimental standalone app start tracing section and links to the detailed integration page.
docs/platforms/dart/guides/flutter/configuration/options.mdx Documents the new enableStandaloneAppStartTracing tracing option.

Comment thread includes/dart-integrations/app-start-instrumentation.mdx
buenaflor and others added 2 commits August 3, 2026 13:31
The sampler reads the operation differently per trace lifecycle: transaction
mode exposes it on the transaction context, while stream mode carries it as the
span's sentry.op attribute. Accessing transactionContext in stream mode logs an
error, so show both variants as tabs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Show how to break the extension down with getExtendedAppStartSpan and
getExtendedAppStartSpanV2, one tab per trace lifecycle. Note that the extension
span is not the active span, so children need an explicit parentSpan, and that
passing a null parentSpan in stream mode starts a root span rather than a child.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread includes/dart-integrations/app-start-instrumentation.mdx

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

Not sure where the line is drawn between documenting or not documenting stream mode, please re-check if we want to include it. Also worth looking at the bot comments.

Comment thread includes/dart-integrations/app-start-instrumentation.mdx Outdated
Comment thread includes/dart-integrations/app-start-instrumentation.mdx
Comment thread includes/dart-integrations/app-start-instrumentation.mdx
buenaflor and others added 4 commits August 3, 2026 13:53
The import pointed at src/integrations/native_app_start_integration.dart, which
the SDK moved to src/app_start/ui_load_attached/. Removing that integration
alone also no longer disables app start, since standalone tracing runs through
StandaloneAppStartIntegration, so remove both.

Replace the firstWhere lookup with a loop as well. App start integrations are
only registered on the platforms that support them, and firstWhere throws when
they are absent.

Co-authored-by: Cursor <cursoragent@cursor.com>
runApp sat between extendAppStart and the try, so a synchronous throw would
leave the extension open until the deadline — the opposite of the guidance right
above the snippet. Move it inside the try.

Apply the same to the child span examples: startChild was outside the try, and
the stream getter now inlines as parentSpan, so nothing that can throw sits
between extending and finishing.

Co-authored-by: Cursor <cursoragent@cursor.com>
The in-flight span streaming pages write these as {tabTitle:Stream Mode} without
a space after the colon. Drop the space so both land consistently.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread includes/dart-integrations/app-start-instrumentation.mdx
The span streaming docs landed on master in #18764, so the page these snippets
refer to now exists. Link it on first mention, matching how the rest of the Dart
docs reference stream mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread includes/dart-integrations/app-start-instrumentation.mdx
@buenaflor
buenaflor merged commit ba10ba1 into master Aug 3, 2026
22 checks passed
@buenaflor
buenaflor deleted the buenaflor/docs/flutter-standalone-app-start branch August 3, 2026 12:18
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