docs(js): Add New Spans guide#17834
Conversation
…ick-start/splitlayout-cleanup
…ick-start/splitlayout-cleanup
… smi/span-first/js
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8d6819. Configure here.
There was a problem hiding this comment.
we mix "service span" and "root span" in this doc. A couple of thoughts:
- I really like the "service span" name (as opposed to "segment span" how we call it in SDK code). I've probably been quite out of the loop here: Is this the public name we ended up choosing for it? Just want to confirm.
- It's probably fine to use "root span" when we talk about how things used to be with transactions but further below, we explain the
ignoreSpansbehaviour differences for child vs. root spans. Should we adjust to "child vs. service spans" there?
There was a problem hiding this comment.
- "service span" is a naming recommendation provided by Shannon -- I've collected the full list here
- I would really like to get use all the different span correctly -- it would be great if you (reviewers) leave a comment when the guide uses the wrong (or not best fitting) name
There was a problem hiding this comment.
I think it could be useful to add two parts to the index to help:
- Definitions (root span, service span, child span)
- A chart like you had in our notes doc, Sarah, to show where each span would live in a trace
There was a problem hiding this comment.
Let me know if this is true, though @Lms24 -
- Root span - the topmost span connected to a trace ID
- Child spans - any span nested under a parent, connected to the same trace ID
- Service span - a parent-level span at the top of a service, nested under the same trace ID as the root span
|
|
||
| <PlatformSection notSupported={["javascript.nextjs", "javascript.nuxt", "javascript.sveltekit", "javascript.astro", "javascript.solidstart", "javascript.capacitor", "javascript.tanstackstart-react", "javascript.remix", "javascript.react-router"]}> | ||
|
|
||
| - **Check the Sentry dashboard**: Spans should appear in the Traces view shortly after they complete. Traces look the same as in transaction mode, but without transactions. |
There was a problem hiding this comment.
Traces look the same as in transaction mode, but without transactions
This is true but unless I missed something, there are very few visual indications that actually point out that a span is a (new) span and not a transaction 😬 The only thing that comes to mind is that it's not showing a JSON button anymore. I don't think there's harm in leaving in this sentence but users might get confused at what they should be looking in the product.
This is of course not a primary docs issue but rather a product/UI issue. We might want to think about some kind of indicator (and, separate topic, please bring back JSON for streamed spans lol). That is assuming, I didn't miss any obvious indication 😅 Will ask product folks about this.
There was a problem hiding this comment.
In that case, I will update this to something like
"Traces look almost the same as in transaction mode. The main difference is that they have no transactions and only consist of spans."
There was a problem hiding this comment.
In the new experience, what do we call those attributes that we currently call transaction?
| ); | ||
|
|
||
| const MainLive = HttpLive.pipe(Layer.provide(SentryLive)); | ||
| MainLive.pipe(Layer.launch, NodeRuntime.runMain); |
There was a problem hiding this comment.
Bug: The Effect server-side code snippet calls NodeRuntime.runMain but is missing the required import for NodeRuntime, which will cause a runtime ReferenceError.
Severity: CRITICAL
Suggested Fix
Add the import statement import { NodeRuntime } from "@effect/platform-node"; to the server-side code snippet in platform-includes/performance/enable-stream-mode/javascript.effect.mdx.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: platform-includes/performance/enable-stream-mode/javascript.effect.mdx#L54
Potential issue: The server-side initialization code snippet in the documentation file
`platform-includes/performance/enable-stream-mode/javascript.effect.mdx` uses
`NodeRuntime.runMain` to launch the application. However, it fails to import
`NodeRuntime` from `@effect/platform-node`. Users who copy and paste this code will
encounter a `ReferenceError: NodeRuntime is not defined` when they try to run their
server, causing the application to crash immediately on startup.
| @@ -0,0 +1,370 @@ | |||
| --- | |||
| title: New Spans | |||
| description: "Learn how to use stream mode to send spans to Sentry as they finish, removing the 1,000-span limit and making trace data visible sooner." | |||
There was a problem hiding this comment.
@cleptric - should we be calling out the 1k span limit as a benefit? Seems really valuable, but want to make sure we're not locking ourselves into something unnecessarily.
| - javascript.cordova | ||
| --- | ||
|
|
||
| <AvailableSince version="10.53.1" /> |
There was a problem hiding this comment.
This is SDK version? Would be good to clarify.
|
|
||
| ## Extended Configuration (Optional) | ||
|
|
||
| ### Filter Spans |
There was a problem hiding this comment.
I think this may be the right place for it, but somewhere on this page I believe we should mention with a slight bit more detail in the description that you also need to modify span.op to span.attributes?.["sentry.op"] and that description becomes name in this new paradigm.
|
|
||
| </Alert> | ||
|
|
||
| ### Drop Spans |
There was a problem hiding this comment.
@Lms24 - just wanting to verify that this behavior is true:
In transaction mode, ignoreSpans is evaluated at transaction end (so all attributes accumulated during the span's lifetime are available). In stream mode, it's evaluated at span start (so only initial attributes are considered).
If so, @inventarSarah, it may be useful to add that detail or heads up here.

DESCRIBE YOUR PR
Adds a new page documenting stream mode for all JS SDKs, covering:
beforeSendSpan,ignoreSpans)Based on this draft: #17621
Michi's draft includes sections on distributed tracing, which I removed in this version. The APIs work identically in both modes; the topics are advanced enough that users are better served by the existing page, where all the details live, and users who already have distributed tracing set up don't need to change anything when switching to stream mode. Happy to discuss if you disagree.
Questions/Considerations for you
Closes: #17835
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:
EXTRA RESOURCES