Skip to content

parentSpanIsAlwaysRootSpan disables options.parentSpan #16769

Closed

Description

@nighca

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

9.31.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Init sentry (browser) as decribed in the doc. The parentSpanIsAlwaysRootSpan will be set true by default, see details here.

  2. In application code, start a span with specific parent span (by options.parentSpan). For example:

    const parentSpan = { /** Some existed span */ }
    const childSpan = Sentry.startInactiveSpan({ parentSpan })
    childSpan.end()

Expected Result

We expect the childSpan to use parentSpan as its parent.

Actual Result

The childSpan uses the root span as its parent.

I think it's a bug because if the user do specify some parentSpan, it means he is clear about the hierarchy structure here and is intended to construct a parent-child relationship. The parentSpanIsAlwaysRootSpan, which I expect to act as a global default behavior, makes it impossible.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 30, 2025
  2. mydea commented on Jun 30, 2025

    @mydea
    Member

    Hey, thanks for writing in. I think this makes sense, I'll see if I can adjust this easily.

  3. self-assigned this
    on Jun 30, 2025
  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 30, 2025
  5. github-actions commented on Jul 4, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #16776, which was included in the 9.35.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions