Title: Structured logs include replay_id when replay is not sampled · Issue #17676 · getsentry/sentry-javascript · GitHub
Open Graph Title: Structured logs include replay_id when replay is not sampled · Issue #17676 · getsentry/sentry-javascript
X Title: Structured logs include replay_id when replay is not sampled · Issue #17676 · 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/17676
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Structured logs include replay_id when replay is not sampled","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/react\n\n### SDK Version\n\n10.12.0\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\nStructured logs are showing a replay_id even when the replay was not sampled due to replaysOnErrorSampleRate. This causes confusion since the replay can’t be found in Sentry.\n\n1. Configure SDK with replaysOnErrorSampleRate: 0.2 (or any low sample rate).\n2. Trigger an error in the app that incudes logs\n3. Notice that a replay_id tag is in the logs even when the replay was not actually captured / attatched to the error due to replaysOnErrorSampleRate\n\nexample issue [here](https://org2-w7.sentry.io/issues/6881627556/?project=4508599466852352&query=is%3Aunresolved&referrer=issue-stream) where logs include a replay_id but no replay is associated with the error or found in [replays search](https://org2-w7.sentry.io/explore/replays/?project=4508599466852352&query=id%3Ae189dfc1b5c44382a124ff75aa67341e&statsPeriod=1h)\n\n\u003cimg width=\"973\" height=\"401\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f7355852-cf32-41cc-9fd0-a8f1c216a883\" />\n\n### Expected Result\n\nIf a replay isn’t sampled and won’t be sent to Sentry, the associated error/log should not include a replay_id\n\n### Actual Result\n\nStructured logs still contain a replay_id, even when the replay is skipped due to sampling. This creates confusion for users who try to search for the replay in Sentry but can’t find it.\n\n### Additional Context\n\n\u003csub>Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/kerenkhatiwada","@type":"Person","name":"kerenkhatiwada"},"datePublished":"2025-09-16T18:50:35Z","url":"https://github.com/getsentry/sentry-javascript/issues/17676"}
| 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:b104384c-3c80-f642-e9d3-7ed7546ccb33 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 904A:12A1D2:B448B8:EAC700:6B051BBA |
| html-safe-nonce | b1e35050f1cdad6fc5073cda6ccd47e0756a3631cb9d34ad467de6a24c1d72fa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDRBOjEyQTFEMjpCNDQ4Qjg6RUFDNzAwOjZCMDUxQkJBIiwidmlzaXRvcl9pZCI6Ijg0NzIxMjkxNTk4OTkxOTIyNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9061c133f798b66a8c7325c3c89be931b9bb29b4b06feb36b0bb9589f3dd8923 |
| hovercard-subject-tag | issue:3423377362 |
| 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/17676/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ffb27ae4eb15c9c12f69a6e831cb34a3c636eadecdf77ed1e5ce7634a575d9f/getsentry/sentry-javascript/issues/17676 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ffb27ae4eb15c9c12f69a6e831cb34a3c636eadecdf77ed1e5ce7634a575d9f/getsentry/sentry-javascript/issues/17676 |
| 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 | kerenkhatiwada |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| 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 | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| 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