Title: Export New Span-Creation APIs from @sentry/browser · Issue #8970 · getsentry/sentry-javascript · GitHub
Open Graph Title: Export New Span-Creation APIs from @sentry/browser · Issue #8970 · getsentry/sentry-javascript
X Title: Export New Span-Creation APIs from @sentry/browser · Issue #8970 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8970
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Export New Span-Creation APIs from @sentry/browser","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/browser\n\n### SDK Version\n\n7.68.0\n\n### Framework Version\n\nReact 7.68.0\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\nThe [documentation](https://docs.sentry.io/platforms/javascript/guides/react/performance/instrumentation/custom-instrumentation/?) 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`:\r\n\r\n\r\nThe PR that introduced these APIs, however, (https://github.com/getsentry/sentry-javascript/pull/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.\r\n\r\nI'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.\n\n### Expected Result\n\nI 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.\n\n### Actual Result\n\n`startActiveSpan` is not exported from `@sentry/react`. It currently needs to be imported from `@sentry/core` to be used in a browser context.","author":{"url":"https://github.com/ssanderson","@type":"Person","name":"ssanderson"},"datePublished":"2023-09-07T11:41:49Z","url":"https://github.com/getsentry/sentry-javascript/issues/8970"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2ae50122-ac94-1683-ff67-dbe3af4ec9f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E9C:169A35:67B034:9177A0:6B0449C2 |
| html-safe-nonce | bde9d13c3b2ad2fc8d30e38ccdf701a820a7c56e505b606865421dc182dff7c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTlDOjE2OUEzNTo2N0IwMzQ6OTE3N0EwOjZCMDQ0OUMyIiwidmlzaXRvcl9pZCI6IjU5MDA2NzczNDE1MTE5NjEwMjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f01fb4d8a11f09995d92c651b65a02e6b803052834658a0f83b08289c2a93956 |
| hovercard-subject-tag | issue:1885725381 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/8970/issue_layout |
| twitter:image | https://opengraph.githubassets.com/55c5ca41fa6f4f90ff8bc2630f17984e2238f61f4b8770bbd57950ed3894053c/getsentry/sentry-javascript/issues/8970 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/55c5ca41fa6f4f90ff8bc2630f17984e2238f61f4b8770bbd57950ed3894053c/getsentry/sentry-javascript/issues/8970 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ssanderson |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width