Skip to content

docs(js): Update Extended Configuration pages for stream mode#17879

Draft
inventarSarah wants to merge 3 commits into
masterfrom
smi/span-first/js-config-updates
Draft

docs(js): Update Extended Configuration pages for stream mode#17879
inventarSarah wants to merge 3 commits into
masterfrom
smi/span-first/js-config-updates

Conversation

@inventarSarah
Copy link
Copy Markdown
Collaborator

@inventarSarah inventarSarah commented May 26, 2026

DESCRIBE YOUR PR

This branch contains updated APIs, Options, and Filter page content for stream mode/new spans.

The PR is currently in Draft because we have two additional PRs open, which cover the same content. I will update this branch with any feedback on these PRs before marking it ready for review.

Closes: #17837

Important

Must only be merged after #17834
This branch is separate from this PR and thus does not contain the new /tracing/new-spans page. However, this branch adds links to that page, which the 404 Linter identifies correctly as broken

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • 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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

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

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment May 27, 2026 8:48am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview May 27, 2026 8:48am

Request Review

{ name: 'startTime', type: 'number', description: 'The timestamp to use for the span start. If not provided, the current time will be used.' },
{ name: 'op', type: 'string', description: 'The operation name for the span. This is used to group spans in the UI' },
{ name: 'forceTransaction', type: 'boolean', description: 'If true, the span will be forced to be sent as a transaction, even if it is not the root span.' },
{ name: 'forceTransaction', type: 'boolean', description: 'If true, the span will be forced to be sent as a transaction, even if it is not the root span. \n// Not available in stream mode. Use `parentSpan: null` instead to make this span show up as service span.' },
Copy link
Copy Markdown
Collaborator Author

@inventarSarah inventarSarah May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding "\n" like this works, but I am not sure if it's "allowed" ;)

        { ... description: 'If true,... \n// Not available in stream mode. Use `parentSpan: null` instead to make this span show up as service span.' },

```javascript {tabTitle:Stream Mode}
Sentry.init({
dsn: "___PUBLIC_DSN___",
beforeSendSpan(span) {
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.

Should this include the Sentry.withStreamedSpan() wrapper?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should -- updated 👍

| Transaction Mode (`SpanJSON`) | Stream Mode (`StreamedSpanJSON`) |
| ---------------------------------- | ----------------------------------- |
| `span.description` | `span.name` |
| `span.data` (processed attributes) | `span.attributes` (raw attributes) |
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.

Should we add more about name and span.op here, like we do in filtering?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an Expandable with the code examples from the Filtering page below -- or did you mean something different?


- `'manual'` (default): You control when profiling starts and stops using the `startProfiler()` and `stopProfiler()` functions. In this mode, profile sampling is only affected by `profileSessionSampleRate`.<PlatformSection notSupported={["javascript.bun", "javascript.cordova", "javascript.capacitor", "javascript.deno", "javascript.cloudflare"]}> Read more about these functions in the <PlatformLink to="/profiling">profiling API documentation</PlatformLink>.</PlatformSection>
- `'trace'`: Profiling starts and stops automatically with transactions, as long as tracing is enabled. The profiler runs as long as there is at least one sampled transaction. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`).
- `'trace'`: Profiling starts and stops automatically with transactions (or service span if you're using <PlatformLink to="/tracing/new-spans">stream mode</PlatformLink>), as long as tracing is enabled. The profiler runs as long as there is at least one sampled transaction. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`).
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.

Suggested change
- `'trace'`: Profiling starts and stops automatically with transactions (or service span if you're using <PlatformLink to="/tracing/new-spans">stream mode</PlatformLink>), as long as tracing is enabled. The profiler runs as long as there is at least one sampled transaction. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`).
- `'trace'`: Profiling starts and stops automatically with transactions (or service spans if you're using <PlatformLink to="/tracing/new-spans">stream mode</PlatformLink>), as long as tracing is enabled. The profiler runs as long as there is at least one sampled transaction. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`).

If you want to drop the transaction/service span, including its child spans:

- Use [`beforeSendTransaction`](#using-beforesendtransaction) in transaction mode.
- Use [`ignoreSpans`](#using-ignore-spans) in stream mode.
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.

Do we need to mention the withStreamedSpan() wrapper here too?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, great catch!
-> added wrapper info

Copy link
Copy Markdown
Contributor

@sfanahata sfanahata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content wise this looks fine, with a couple of questions about adding/referencing the same info across these pages. See comments for details.

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.

Update JS SDK Options and APIs page for stream mode/new spans

2 participants