Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replay): Change the behavior of error-based sampling #7768

Merged
merged 51 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5641265
feat(replay): Change `stop()` to flush and remove current session
billyvg Apr 4, 2023
14b4b5d
lint
billyvg Apr 4, 2023
cd3c1d6
remove async
billyvg Apr 5, 2023
ac8a4b6
remove redundant flag change
billyvg Apr 5, 2023
3fab0b2
Update packages/replay/src/session/clearSession.ts
billyvg Apr 5, 2023
45996ed
return promise
billyvg Apr 14, 2023
756f716
remove shouldFinalFlush
billyvg Apr 24, 2023
d1990e1
Merge branch 'develop' into feat-replay-change-stop-flush-clear-session
billyvg Apr 24, 2023
aa34bc5
prettier
billyvg Apr 24, 2023
b43de34
await
billyvg Apr 24, 2023
b2c8ffc
remove await
billyvg Apr 24, 2023
d04a90d
Merge branch 'develop' into feat-replay-change-stop-flush-clear-session
billyvg Apr 24, 2023
061ead9
need to await stop
billyvg Apr 25, 2023
b5993fb
ref(replay): Add `capture()` API to record current event buffer
billyvg Apr 4, 2023
d14b76d
rename and change options
billyvg Apr 5, 2023
439e95f
update comments
billyvg Apr 5, 2023
e075145
flush immediate in session mode as well
billyvg Apr 13, 2023
3cd50a2
feat(replay): Change the behavior of error-based sampling
billyvg Apr 5, 2023
5c87ecc
session should be undefined
billyvg Apr 5, 2023
1632a41
update test
billyvg Apr 5, 2023
468b95c
add startBuffering, change recordingMode from error to buffer, some f…
billyvg Apr 13, 2023
716205f
update tests
billyvg Apr 13, 2023
ef5e4f1
unused
billyvg Apr 14, 2023
96f39ee
update error -> buffer
billyvg Apr 14, 2023
f640ae9
fix test
billyvg Apr 14, 2023
8455dd0
update replay_type
billyvg Apr 17, 2023
e7262d3
add test
billyvg Apr 18, 2023
ace37ef
remove listeners
billyvg Apr 24, 2023
3fdd0ab
replay_start_timestamp
billyvg Apr 24, 2023
4ad1e5e
lint
billyvg Apr 24, 2023
9d00b5c
add a test
billyvg Apr 24, 2023
2a64ab7
update test
billyvg Apr 24, 2023
3c272c1
await error promise
billyvg Apr 24, 2023
f21f10d
fix: Do refresh buffered sessions (#7931)
mydea Apr 24, 2023
8446202
remove unused type
billyvg Apr 25, 2023
5d0e024
ref: change `getSession` param errorSampleRate to allowBuffering
billyvg Apr 25, 2023
9ac9d92
setTimeout is only needed in `setupOnce`
billyvg Apr 25, 2023
cff6f95
update TOOD comment
billyvg Apr 25, 2023
fd448a6
inline flush options
billyvg Apr 25, 2023
dc8cd6c
Merge branch 'develop' into feat-replay-change-stop-flush-clear-session
billyvg Apr 25, 2023
bdb78f2
Merge branch 'develop' into feat-replay-change-sampling-logic
billyvg Apr 25, 2023
c99357a
Merge branch 'feat-replay-change-stop-flush-clear-session' into feat-…
billyvg Apr 25, 2023
5c66ac4
lint + update added tests
billyvg Apr 25, 2023
73b2034
Merge branch 'develop' into feat-replay-change-sampling-logic
billyvg Apr 26, 2023
338911c
ERROR_CHECKOUT_TIME --> BUFFER_CHECKOUT_TIME
billyvg Apr 26, 2023
ea8b957
fix bad merge
billyvg Apr 26, 2023
ff5fc97
update types
billyvg Apr 26, 2023
b47c593
Merge branch 'develop' into feat-replay-change-sampling-logic
billyvg Apr 26, 2023
d7554b8
lint
billyvg Apr 26, 2023
1408f84
fix test
billyvg Apr 26, 2023
31f99fd
fix test
mydea Apr 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
flushMinDelay: 1000,
flushMaxDelay: 1000,
});

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
sampleRate: 1,
replaysSessionSampleRate: 0.0,
replaysOnErrorSampleRate: 0.0,

integrations: [window.Replay],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
document.getElementById('go-background').addEventListener('click', () => {
Object.defineProperty(document, 'hidden', { value: true, writable: true });
const ev = document.createEvent('Event');
ev.initEvent('visibilitychange');
document.dispatchEvent(ev);
});

document.getElementById('error').addEventListener('click', () => {
throw new Error('Ooops');
});

document.getElementById('error2').addEventListener('click', () => {
throw new Error('Another error');
});

document.getElementById('log').addEventListener('click', () => {
console.log('Some message');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<button id="go-background">Go to background</button>
<button id="error">Throw Error</button>
<button id="error2">Another Error</button>
<button id="log">Log stuff to the console</button>
</body>
</html>
Loading