Skip to content

Export New Span-Creation APIs from @sentry/browser #8970

Closed
@ssanderson

Description

@ssanderson

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

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:
image

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

Labels

Package: browserIssues related to the Sentry Browser SDK

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions