-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to create spans as children of specific spans #12539
Comments
I am also in favor of the 2nd option, as having too many APIs would make everything more complex to use (as you need to think of even more different APIs which do quite similar things). |
mydea
added a commit
that referenced
this issue
Jun 20, 2024
With this PR, you can now pass a `parentSpan` optionally to `startSpan*` APIs to create a span as a child of a specific span: ```js const span = Sentry.startInactiveSpan({ name: 'xxx', parentSpan: parent }); Sentry.startSpan({ name: 'xxx', parentSpan: parent }, () => {}); Sentry.startSpanManual({ name: 'xxx', parentSpan: parent }, () => {}); ``` With this, it should be easier to understand how you can manually work with spans in v8. Closes #12539 ref #12566, which I noticed while working on this. For now I just cast the span which should be fine, but is not ideal.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible today, with the new APIs, to create a span as a child of a specific other span:
However, this is not super intuitive for users. We should provide some helper/utility/way to do this easier.
I see two main ways we could do this:
Sentry.startInactiveChildSpan(parent, spanOptions)
parentSpan
option to allstartSpan*
methods:I think I'd tend to the second option, and we should be able to implement this both for core as well as for otel.
The text was updated successfully, but these errors were encountered: