René's URL Explorer Experiment


Title: Add option to sample linked traces consistently · Issue #15754 · getsentry/sentry-javascript · GitHub

Open Graph Title: Add option to sample linked traces consistently · Issue #15754 · getsentry/sentry-javascript

X Title: Add option to sample linked traces consistently · Issue #15754 · getsentry/sentry-javascript

Description: We should provide a way for users to sample consistently positively or negatively based on the previous/initial trace (i.e. the one we link since #14992). Concretely, we propose to add an option to browserTracingIntegration: Sentry.init(...

Open Graph Description: We should provide a way for users to sample consistently positively or negatively based on the previous/initial trace (i.e. the one we link since #14992). Concretely, we propose to add an option to...

X Description: We should provide a way for users to sample consistently positively or negatively based on the previous/initial trace (i.e. the one we link since #14992). Concretely, we propose to add an option to...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/15754

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add option to sample linked traces consistently","articleBody":"We should provide a way for users to sample consistently positively or negatively based on the previous/initial trace (i.e. the one we link since #14992). Concretely, we propose to add an option to `browserTracingIntegration`:\n\n```js\nSentry.init({\n  integrations: [\n    browserTracingIntegration({\n      linkPreviousTrace: 'in-memory', // other values 'session-storage' | 'off'\n      sampleLikePreviousTrace: true, // does nothing if linkPreviousTrace === 'off'\n    })\n  ]\n})\n```\n\nThis option is opt-in, meaning by default, the SDK continues to sample independently between traces. \n\nSpecifically, if `sampleLikePreviousTrace` is `true`\n- force a positive sampling decision if previous trace was sampled positively\n  - ensure that sample rand and rate from initial trace is applied and propagated in new trace\n- force negative sampling decision if previous trace was sampled negatively\n- fall back to user-defined sampling mechanism (`tracesSampleRate` or `tracesSampler`) if no previous trace available (e.g. because first trace in chain or `linkPreviousTrace === 'off'`)\n- injected meta tags on pageload have precedence over previous trace sampling decision (if session-storage is opted into)\n\nOtherwise, fall back to fall back to user-defined sampling mechanism (`tracesSampleRate` or `tracesSampler`) => independent sampling.\n\nAs for implementation: We probably can reuse the `beforeSampling` client hook to keep the logic in `browserTracingIntegration`. But we need to make sure that the hook emits in `sampleSpan` (or prior to calling it) within the Core SDK. Also we need to update or set the propagation context accordingly.\n\nIn other words, the only way how consistent sampling across traces can work is by pretending it is continuing a sampling decision within a distributed trace. Which is a fundamental limitation of the tracing and metrics model we're building at Sentry. This really shows that `tracesSampler` still permits a lot of possibilities for users to influence extrapolation in unexpected ways.\n\n### Naming\n\nNaming is hard and I don't have a great name yet for this option. Some suggestions:\n\n- `sampleLikePreviousTrace` \n- `sampleLinkedTraces(Consistently|Uniformly)`\n- `forwardSamplingToLinkedTraces`\n- `forwardSamplingToNextTrace`\n- `sampleTracesConsistently` \n- `consistentTraceSampling` \u003c-- this is what we went with in #16037 \n\n---\n\nThe initial proposal was reworked b/c it would have significantly skewed span metric extrapolation. I'm leaving this here for some context as to what we could have had. \n\n### Initial Proposal (for context)\n\n#### Description\n\nWe should provide a way for users to make a sampling decision for a trace based on the sampling decision of the previous trace (i.e. the one we link since #14992). Concretely, we propose to add an option to `tracesSampler`:\n\n```js\nSentry.init({\n  dsn: '...',\n  tracesSampler(({previousTraceSampled}) => {\n    if (previousTraceSampled) {\n      return 1.0; // could also just increase the rate, e.g. to 0.5\n    } else if (previousTraceSampled === false) {\n      return 0;\n    }\n    return 0.05;\n  })\n})\n```\n\nwhere `previousTraceSampled` is typed as `boolean | undefined`. The semantics for all values:\n\n- `true` - previous trace was positively sampled and sent to Sentry (this makes no guarantees that this trace in fact was stored; it can still be dropped by Relay)\n- `false` - previous trace was negatively sampled and not Sent to Sentry\n- `undefined` - multiple implications\n  - the current trace is the first one\n  - previous trace collection is disabled by users\n  - previous trace collection is not available (e.g. server SDK) \n\nThis allows users to ensure that a trace chain is longer or in general more complete. \n\nImportant notes:\n- By default the SDK will not continue a positive sampling decision based on the previous trace. This must be a concious user decision to opt into. \n- The potential quota increase must be mentioned in JSDoc and docs","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2025-03-20T12:02:53Z","url":"https://github.com/getsentry/sentry-javascript/issues/15754"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:456a40fd-90cf-f02c-aa2b-28716716aeae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBD70:18D8CC:1F4A2AF:28B11BC:6B040A63
html-safe-nonce07340bb1067b196f1949f639b50674416614f1851be9ab82a3d1b23da35c0d10
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDcwOjE4RDhDQzoxRjRBMkFGOjI4QjExQkM6NkIwNDBBNjMiLCJ2aXNpdG9yX2lkIjoiNzU3MjUxODMyMzgyOTg2OTE1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0e14730129877c0e05f59a5e28a2599232520d47cc223828a755cb481689c3af
hovercard-subject-tagissue:2935229383
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/15754/issue_layout
twitter:imagehttps://opengraph.githubassets.com/743e5a22d8256ea01c8a2019046263f9f6e2851a8651506eebf929281a00d8e8/getsentry/sentry-javascript/issues/15754
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/743e5a22d8256ea01c8a2019046263f9f6e2851a8651506eebf929281a00d8e8/getsentry/sentry-javascript/issues/15754
og:image:altWe should provide a way for users to sample consistently positively or negatively based on the previous/initial trace (i.e. the one we link since #14992). Concretely, we propose to add an option to...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameLms24
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/15754#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F15754
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F15754
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/15754
Reloadhttps://github.com/getsentry/sentry-javascript/issues/15754
Reloadhttps://github.com/getsentry/sentry-javascript/issues/15754
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues342 (342)https://github.com/getsentry/sentry-javascript/issues
Pull requests60 (60)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/15754
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/15754
#16037https://github.com/getsentry/sentry-javascript/pull/16037
Add option to sample linked traces consistentlyhttps://github.com/getsentry/sentry-javascript/issues/15754#top
#16037https://github.com/getsentry/sentry-javascript/pull/16037
https://github.com/Lms24
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
https://github.com/Lms24
Lms24https://github.com/Lms24
on Mar 20, 2025https://github.com/getsentry/sentry-javascript/issues/15754#issue-2935229383
#14992https://github.com/getsentry/sentry-javascript/issues/14992
feat(browser): Add option to sample linked traces consistently #16037https://github.com/getsentry/sentry-javascript/pull/16037
#14992https://github.com/getsentry/sentry-javascript/issues/14992
Lms24https://github.com/Lms24
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=type:"Task"
on Mar 20, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-16907329058
Lms24https://github.com/Lms24
Package: corehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20core%22
on Mar 20, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-16907441178
Lms24https://github.com/Lms24
on Mar 31, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17060048574
getsentry/sentry-javascripthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22getsentry%2Fsentry-javascript%22
on Apr 7, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17159603417
linearhttps://github.com/apps/linear
SDKs (New)https://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SDKs%20(New)%22
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
on Apr 7, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17159617011
stephanie-andersonhttps://github.com/stephanie-anderson
SDKs (New)https://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SDKs%20(New)%22
on Apr 8, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17167305681
Lms24https://github.com/Lms24
on Apr 9, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17184983549
stephanie-andersonhttps://github.com/stephanie-anderson
getsentry/sentry-javascripthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22getsentry%2Fsentry-javascript%22
on Apr 9, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17189314342
mydeahttps://github.com/mydea
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
on Apr 14, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17250190845
Lms24https://github.com/Lms24
on Apr 17, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17302241799
Lms24https://github.com/Lms24
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#16037https://github.com/getsentry/sentry-javascript/pull/16037
on May 5, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17518771931
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on May 7, 2025https://github.com/getsentry/sentry-javascript/issues/15754#issuecomment-2858865819
GitHub Actionshttps://help.github.com/en/actions
#16037https://github.com/getsentry/sentry-javascript/pull/16037
9.16.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/9.16.0
aviator-apphttps://github.com/apps/aviator-app
on May 30, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-17879577794
[Snyk] Upgrade @sentry/browser from 9.10.0 to 9.17.0 (#386)https://github.com/reisene/HulajDusza-serwis/commit/0cb81b2658027ca489aea0cc7ab11d568edb6c27
#386https://github.com/reisene/HulajDusza-serwis/pull/386
0cb81b2https://github.com/reisene/HulajDusza-serwis/commit/0cb81b2658027ca489aea0cc7ab11d568edb6c27
billyvghttps://github.com/billyvg
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-19018326706
billyvghttps://github.com/billyvg
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-19018768292
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
on Aug 12, 2025https://github.com/getsentry/sentry-javascript/issues/15754#event-19124557207
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/15754
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/15754
Lms24https://github.com/Lms24
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.