Title: Change Replay sampling to sample on each error · Issue #7735 · getsentry/sentry-javascript · GitHub
Open Graph Title: Change Replay sampling to sample on each error · Issue #7735 · getsentry/sentry-javascript
X Title: Change Replay sampling to sample on each error · Issue #7735 · getsentry/sentry-javascript
Description: Current State Our current sampling logic for error-based samples is a bit confusing: we take the sample at the beginning of the session, before any error even occurs. This was a decision we made when the project first started in order to...
Open Graph Description: Current State Our current sampling logic for error-based samples is a bit confusing: we take the sample at the beginning of the session, before any error even occurs. This was a decision we made wh...
X Description: Current State Our current sampling logic for error-based samples is a bit confusing: we take the sample at the beginning of the session, before any error even occurs. This was a decision we made wh...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/7735
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change Replay sampling to sample on each error","articleBody":"# Current State\nOur current sampling logic for error-based samples is a bit confusing: we take the sample at the beginning of the session, *before* any error even occurs. This was a decision we made when the project first started in order to be able quickly kill the SDK without having to deploy anything, as well as being able to avoid the SDK overhead for un-sampled sessions.\n\nThe sampling logic makes sense for sessions with only 1 error. For example, at an error sample rate of 50%, if you have 100 errors you would expect ~50 replays. However, if the average session has 10 errors, our existing sampling logic would produce ~5 replays (100 errors / 10 errors per session = 10 sessions * 50% sample rate = 5 replays).\n\nThis outcome is quite unexpected and can simply be considered wrong. It also prevents us from a very requested feature: custom logic to determine what errors will produce a replay.\n\n# Proposal\n\n## Sample on each error\n\nChange the sampling sequence so that we make sampling decisions when an error occurs, instead of when the Replay integration is initialized and session is created.\n\n- if both sample rates are 0, replay recording does not start\n- if session sample rate > 0\n - make sampling decision for session-based replay\n - if sampled, call `start()`\n - else, move on to error sample logic\n- if error sample rate > 0\n - start recording only (same behavior as our current onError flow, buffers events and does not upload replay) and wait until an error occurs","author":{"url":"https://github.com/billyvg","@type":"Person","name":"billyvg"},"datePublished":"2023-04-04T15:45:32Z","url":"https://github.com/getsentry/sentry-javascript/issues/7735"}
| 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:2d5cdcac-c1d7-ad17-8d9d-ee02eef9facf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFB0:31FAF9:6D852:97E46:6B04A3AA |
| html-safe-nonce | 5e95ff56f62a3c01ec6b7735fe946edf94739112f8eb5df147b633827ccde512 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkIwOjMxRkFGOTo2RDg1Mjo5N0U0Njo2QjA0QTNBQSIsInZpc2l0b3JfaWQiOiIzNjQ3Njk2NjA1MDkzODY0MzYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | de84762b5bdb37ffc628f5d729225cf75c571bcfc2469de98cd078ff8d18236e |
| hovercard-subject-tag | issue:1654140354 |
| 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/7735/issue_layout |
| twitter:image | https://opengraph.githubassets.com/310c5e2ec1fd8b510771968fab905b557ec0a4cde02c0cf13d56ec6b666e3c40/getsentry/sentry-javascript/issues/7735 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/310c5e2ec1fd8b510771968fab905b557ec0a4cde02c0cf13d56ec6b666e3c40/getsentry/sentry-javascript/issues/7735 |
| og:image:alt | Current State Our current sampling logic for error-based samples is a bit confusing: we take the sample at the beginning of the session, before any error even occurs. This was a decision we made wh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | billyvg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| 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 | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| 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