Skip to content

Manually sampling transactions result in missing child spans #3254

@rhcarvalho

Description

@rhcarvalho

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

 6.1.0

Description

Originally reported at https://forum.sentry.io/t/child-spans-not-linked-to-parent/12854

Example to reproduce: https://codesandbox.io/s/wonderful-chaplygin-bwwjw?file=/src/App.js (thanks @dashed)

Given the code:

const tx = Sentry.startTransaction({ name: 'index', op: 'index', sampled: true });
const span = tx.startChild({ op: 'child' });
const span2 = span.startChild({ op: 'grandkid' });
span2.finish();
span.finish();
tx.finish();

None of the child spans are reported. Removing the sampled: true works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions