Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
7.68.0
Framework Version
React 7.68.0
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
The documentation for Custom Instrumentation suggests that setActiveSpan
is the idiomatic way to add custom tracing spans in all of Sentry's javascript SDKs. Moreover, the examples in the above documentation show that these methods are exported from @sentry/react
:
The PR that introduced these APIs, however, (#8803) only exposes them at the top level from node, serverless, and sveltekit, which means the code in the documentation doesn't work as written.
I'm not sure if this is a bug in the code or the documentation, but given that these functions were exposed at top level, it seems like probably an accidental oversight that these weren't exposed at top level. Is there some reason why these methods shouldn't be similarly exposed in the browser SDKs? At minimum, the documentation should be updated to reflect supported usage.
Expected Result
I expect the documented usage of importing startActiveSpan
from @sentry/react
to work. It seems like the most obvious way to make this work is to expose it from @sentry/browser
, which gets re-exported from most of the other framework-specific browser SDKs.
Actual Result
startActiveSpan
is not exported from @sentry/react
. It currently needs to be imported from @sentry/core
to be used in a browser context.
Metadata
Metadata
Assignees
Type
Projects
Status