docs(dart): Cover stream mode across tracing pages#18611
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Pull request overview
Updates the Dart and Flutter tracing documentation to clarify how stream mode (span streaming) affects manual/automatic instrumentation and distributed trace continuation, aligning the tracing pages with the newer span APIs.
Changes:
- Adds stream mode callouts to manual instrumentation pages, directing readers to
Sentry.startSpanAPIs (since transaction APIs are no-ops in stream mode). - Adds stream mode callouts to automatic instrumentation pages noting that auto-instrumentation switches to streaming span APIs automatically.
- Adds stream mode callouts to trace propagation pages noting that continuing an incoming distributed trace isn’t supported yet in stream mode.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/platforms/dart/guides/flutter/tracing/trace-propagation/index.mdx | Adds a stream mode limitation callout for continuing incoming distributed traces. |
| docs/platforms/dart/guides/flutter/tracing/instrumentation/custom-instrumentation.mdx | Adds a stream mode callout pointing manual instrumentation to Sentry.startSpan and New Spans. |
| docs/platforms/dart/guides/flutter/tracing/instrumentation/automatic-instrumentation.mdx | Adds a stream mode callout stating auto-instrumentation switches APIs automatically and links to New Spans. |
| docs/platforms/dart/common/tracing/trace-propagation/index.mdx | Adds a stream mode limitation callout for continuing incoming distributed traces. |
| docs/platforms/dart/common/tracing/trace-propagation/custom-instrumentation/index.mdx | Adds a stream mode limitation callout and links to New Spans. |
| docs/platforms/dart/common/tracing/instrumentation/custom-instrumentation.mdx | Adds a stream mode callout pointing manual instrumentation to Sentry.startSpan and New Spans. |
| docs/platforms/dart/common/tracing/instrumentation/automatic-instrumentation.mdx | Adds a stream mode callout stating auto-instrumentation switches APIs automatically and links to New Spans. |
45fa64b to
dff9eb6
Compare
fedd806 to
fbc2c56
Compare
Point custom instrumentation to the new Sentry.startSpan APIs for stream mode, note that automatic instrumentation switches to the streaming span API automatically, and flag that continuing an incoming distributed trace isn't supported yet in stream mode. Covers both Dart and Flutter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Convert the custom-instrumentation code snippets to dual Transaction Mode (Default) / Stream Mode tabs, mirroring the Python docs approach. Reword prose to cover both modes. Co-Authored-By: Claude <noreply@anthropic.com>
Use Sentry.startSpan (async) in all stream mode snippets instead of mixing in startSpanSync; startSpanSync is documented once in New Spans as the synchronous-signature variant. Co-Authored-By: Claude <noreply@anthropic.com>
Genericize automatic-instrumentation and performance-metrics prose to cover both modes, and add a Stream Mode tab to custom performance metrics (setMeasurement -> span attributes). Co-Authored-By: Claude <noreply@anthropic.com>
Add a New Spans pointer and mode-aware wording to the tracing setup and Verify sections, note that distributed-trace continuation and transaction naming differ in stream mode, and genericize the features overview. Co-Authored-By: Claude <noreply@anthropic.com>
Use SentryAttribute.stringArray/intArray/boolArray for the array cases, matching the transaction-mode setData arrays. Co-Authored-By: Claude <noreply@anthropic.com>
fbc2c56 to
2fc3a53
Compare
|
|
||
| <Alert> | ||
|
|
||
| In stream mode, continuing an incoming distributed trace isn't supported yet. See <PlatformLink to="/tracing/new-spans/">New Spans</PlatformLink>. |
There was a problem hiding this comment.
I would also add a note about this to the main page if that sounds alright to you
There was a problem hiding this comment.
Hmm, I am thinking that since Flutter is a mobile SDK and therefore always head of the trace, there is no use case for incoming traces and we don't support any backend use cases for Dart
Not sure how much we need to point out incoming distributed tracing since for the almost all of users in Dart/Flutter this won't be relevant
There was a problem hiding this comment.
If it's not relevant for most users, then let's keep it here as a note and not include it in the main page 👍
| ## Add More Spans to the Transaction/Service Span | ||
|
|
||
| By default, transactions are not bound to the scope. Transaction has to be passed manually as a method parameter to enable attaching nested spans. When creating nested span, you can choose the value of `operation` and `description`. | ||
| In transaction mode, transactions aren't bound to the scope, so the transaction has to be passed manually as a method parameter to attach nested spans. In stream mode, nested spans attach to the active span automatically — no manual passing needed. When creating a nested span, you can choose its name and `sentry.op`. |
There was a problem hiding this comment.
What is "sentry.op"? - I haven't seen that in our Dart docs until now
There was a problem hiding this comment.
Oh, is that for startTransaction?
There was a problem hiding this comment.
the operation parameter is not built into the function like in startTransaction and instead in startSpan you'd have to add it yourself. however I am not entirely sure if we wanna document this at all - does python document this?
There was a problem hiding this comment.
In Python, almost all startSpan examples include sentry.op. And in the migration guide, we explicitly state: "- op is no longer a dedicated argument — set it as the sentry.op attribute instead."
Example:
with sentry_sdk.traces.start_span(name="SELECT", attributes={"sentry.op": "db"}, parent_span=parent):
...
So from your comment, I assume it is the same in Dart where you have to add op as an attribute?
There was a problem hiding this comment.
yes, it's the same in Dart - then I guess we can also keep documenting it here
DESCRIBE YOUR PR
Documents stream mode across the Dart/Flutter tracing pages. Following the Python precedent, code snippets gain a
Stream Modetab next toTransaction Mode (Default)(nothing is removed), and prose is genericized to cover both modes.startSpan-onlysetMeasurement→ span attributesStacked on #18554 — review/merge that first.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: