Skip to content

feat(replay): Migrate sentry-replay into monorepo #6270

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

Merged
merged 355 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
355 commits
Select commit Hold shift + click to select a range
b5b3a3c
feat(build): Clean up deps and update rollup-plugin-resolve-node (get…
billyvg Jun 1, 2022
25b281e
fix: Incorrect tagging of root event (getsentry/sentry-replay#80)
billyvg Jun 2, 2022
95ac7ff
ref: Move instrumentation handlers into main plugin class (getsentry…
billyvg Jun 3, 2022
b088d68
ref: Refactor the rrweb record handler (getsentry/sentry-replay#81)
billyvg Jun 3, 2022
9c87c27
feat: Upload replay after receiving event from core SDK (getsentry/se…
billyvg Jun 3, 2022
18e3f05
v0.2.0-14
billyvg Jun 3, 2022
7e6a9ca
feat: Add a breadcrumb for when page closes (getsentry/sentry-replay#84)
billyvg Jun 6, 2022
dba8aa0
feat: Add compression in webworker
JoshFerge Jun 14, 2022
fc2ec56
v0.2.0-15
billyvg Jun 14, 2022
5b94014
v0.2.0-16
billyvg Jun 14, 2022
67ab89c
v0.2.0-17
billyvg Jun 14, 2022
d6671e6
ref: Move configuration files into `config/` (getsentry/sentry-replay…
billyvg Jun 21, 2022
3755102
feat: Abstract sessions to a class (getsentry/sentry-replay#91)
billyvg Jun 24, 2022
5cf1454
dev: Use node16 for local development (getsentry/sentry-replay#97)
billyvg Jun 27, 2022
7e0b689
ref: Move checking ingest endpoint logic into fn and add tests (getse…
billyvg Jun 28, 2022
4c49619
feat: Change `VISIBILITY_CHANGE_TIMEOUT` to match `SESSION_IDLE_DURAT…
billyvg Jun 29, 2022
9073312
v0.2.0-18
billyvg Jun 29, 2022
db27dbb
feat: Add breadcrumbs when visibility changes (getsentry/sentry-repla…
billyvg Jun 30, 2022
54e8adc
v0.2.0-19
billyvg Jun 30, 2022
685f33f
feat: Remove breadcrumb from "visibilitychange" event (getsentry/sent…
billyvg Jul 6, 2022
e9203e5
ref: Move creation of root replay into a fn (getsentry/sentry-replay#…
billyvg Jul 7, 2022
f103862
ref(lint): Add `no-unused-vars` (getsentry/sentry-replay#107)
billyvg Jul 14, 2022
9f50898
ref: Upgrade and clean-up `@sentry` SDK deps/imports (getsentry/sentr…
billyvg Jul 15, 2022
cf79faf
feat: Defer capturing root replay until upload (getsentry/sentry-repl…
billyvg Jul 15, 2022
e543c5e
v0.3.0
billyvg Jul 18, 2022
ee3ac95
v0.4.0
billyvg Jul 18, 2022
30ab51f
fix: Order of capturing replay events and uploading replay is a bit w…
billyvg Jul 18, 2022
8eb8314
feat: Do not flush immediately on checkout (getsentry/sentry-replay#109)
billyvg Jul 18, 2022
a5db97b
v0.4.1
billyvg Jul 18, 2022
0859942
fix: guard against undefined new breadcrumbs in `handleScope`
billyvg Jul 19, 2022
969f859
v0.4.2
billyvg Jul 19, 2022
7183fee
v0.4.3
billyvg Jul 19, 2022
be09e77
build: prepublishOnly -> prepack
billyvg Jul 19, 2022
294a674
v0.4.5
billyvg Jul 19, 2022
08953ff
ref: Refactor the recording emit handler (getsentry/sentry-replay#111)
billyvg Jul 21, 2022
fd98595
feat: Only capture replays when errors happen (getsentry/sentry-repla…
billyvg Jul 21, 2022
c333e20
ref: Change configuration API (getsentry/sentry-replay#114)
billyvg Jul 25, 2022
2e6444a
feat: Capture the correct timestamps and initial URL when sending eve…
billyvg Jul 25, 2022
6911046
v0.4.6
billyvg Jul 25, 2022
d578977
feat: Add client sampling (getsentry/sentry-replay#118)
billyvg Jul 27, 2022
bc5b7a1
build(deps): bump async from 2.6.3 to 2.6.4 in /demo (getsentry/sentr…
dependabot[bot] Jul 27, 2022
5ec0821
ref: Rename `sequence` to `segment` (getsentry/sentry-replay#121)
billyvg Jul 27, 2022
3b54329
build(deps): bump terser from 5.12.0 to 5.14.2 in /demo (getsentry/se…
dependabot[bot] Jul 27, 2022
91ca25d
ref: Move `captureEvent` call to function (getsentry/sentry-replay#120)
billyvg Jul 27, 2022
9f42d92
build(deps): bump terser from 5.13.1 to 5.14.2 (getsentry/sentry-repl…
dependabot[bot] Jul 27, 2022
b67483f
dev: Add `eslint-plugin-simple-import-sort` to organize imports (gets…
billyvg Jul 27, 2022
0cd8c6e
dev: Add `size-limit` scripts for local env (getsentry/sentry-replay#…
billyvg Jul 28, 2022
ced3a6f
ci: Add `size-limit` to show package size (getsentry/sentry-replay#123)
billyvg Jul 28, 2022
c8f73bd
fix: Sentry event timestamps need to be in seconds (getsentry/sentry-…
billyvg Jul 28, 2022
5f43ca7
ci: separate `size-limit` into own workflow
billyvg Jul 28, 2022
ee8d8d5
fix: Duplicate events due to compression WebWorker (getsentry/sentry-…
billyvg Jul 29, 2022
d427743
ci: fix size-limit, do not skip install
billyvg Jul 29, 2022
57c9e3d
ref: Change function params for `captureReplay*` to accept object (ge…
billyvg Jul 29, 2022
ad78c98
v0.4.7
billyvg Jul 29, 2022
855a4a0
docs: Add formatting to Config table in the readme (getsentry/sentry-…
ryan953 Aug 4, 2022
e9db6aa
docs: Update install instructions (getsentry/sentry-replay#136)
ryan953 Aug 4, 2022
d53a15d
feat: Collect Sentry error event ids when creating replay events (get…
billyvg Aug 4, 2022
5bb8f98
feat: Add/fix debugging messages in compression worker (getsentry/sen…
billyvg Aug 4, 2022
d42386d
feat: use core SDK to handle fetch/xhr requests (getsentry/sentry-rep…
billyvg Aug 8, 2022
16363fd
feat: Fix `error_ids` key and add `trace_ids` (getsentry/sentry-repla…
billyvg Aug 8, 2022
b5338f0
feat: Add navigation events (getsentry/sentry-replay#142)
billyvg Aug 10, 2022
d4e3e14
v0.4.8
billyvg Aug 10, 2022
e7e5ab6
feat: Do not send breadcrumbs with replay event (getsentry/sentry-rep…
billyvg Aug 12, 2022
fc449f7
ref: Change `postMessage` to handle web worker callback messages (get…
billyvg Aug 12, 2022
40d700e
v0.4.9
billyvg Aug 12, 2022
355afef
ref(api): Updates for new backend (getsentry/sentry-replay#93)
billyvg Aug 12, 2022
4d10541
v0.5.0
billyvg Aug 12, 2022
a14c477
fix(build): Fix types output dir
billyvg Aug 12, 2022
06296c0
fix(build): Fix include/exclude w/ rollup
billyvg Aug 12, 2022
b0941a8
fix(build): Fix types outdir dir try getsentry/sentry-replay#2
billyvg Aug 12, 2022
9d0d1c6
v0.5.1
billyvg Aug 12, 2022
90f759b
fix(build): Add `types` to package.json
billyvg Aug 12, 2022
07023d7
v0.5.2
billyvg Aug 12, 2022
c15111c
fix: Fix resetting initial state when loading new session (getsentry/…
billyvg Aug 17, 2022
bb30c18
v0.5.3
billyvg Aug 17, 2022
e91e00f
ref: Refactor adding event to event buffer (getsentry/sentry-replay#151)
billyvg Aug 18, 2022
ef02638
feat: Remove sendBeacon() usage (getsentry/sentry-replay#152)
billyvg Aug 18, 2022
b400983
feat: capture exception to Sentry when uploading replay fails (getsen…
billyvg Aug 18, 2022
ae2ef5b
v0.5.4
billyvg Aug 18, 2022
5fc9585
ref(tests): Refactor `addEvent` call (getsentry/sentry-replay#155)
billyvg Aug 18, 2022
54b8d04
feat: Inspect events for earliest timestamp (getsentry/sentry-replay#…
billyvg Aug 19, 2022
6b335fa
v0.5.5
billyvg Aug 19, 2022
80983f6
Fix: Cannot read properties of undefined (getsentry/sentry-replay#160)
ryan953 Aug 29, 2022
4f965fb
feat: Do not flush for network requests (getsentry/sentry-replay#158)
billyvg Aug 30, 2022
a0b2d9e
v0.5.6
billyvg Aug 30, 2022
086c186
feat: Remove window unload event (getsentry/sentry-replay#166)
billyvg Aug 31, 2022
bf2f785
feat: Do not create blur/focus breadcrumbs when expired (getsentry/se…
billyvg Aug 31, 2022
65caff0
feat: serialize before posting message to webworker (getsentry/sentry…
billyvg Aug 31, 2022
c17261b
v0.5.7
billyvg Aug 31, 2022
0d91d74
v0.5.8
billyvg Aug 31, 2022
aff8cb9
fix: Fix duplicate navigation entries (getsentry/sentry-replay#168)
billyvg Sep 1, 2022
c4e5661
build: Apply `strictNullChecks` to base config
billyvg Sep 1, 2022
84922f8
fix: Fix type for handleMessage
billyvg Sep 1, 2022
f1fe308
v0.5.9
billyvg Sep 1, 2022
38c180f
feat: Add `deleteSession()` (getsentry/sentry-replay#173)
billyvg Sep 6, 2022
a11e522
feat: Make `stickySession` default to `true` (getsentry/sentry-replay…
billyvg Sep 6, 2022
5377269
fix: Ignore unsupported PerformanceObserver types (getsentry/sentry-r…
billyvg Sep 6, 2022
f6ba4bf
feat: Do not alter time. (getsentry/sentry-replay#169)
billyvg Sep 6, 2022
4a852f5
v0.5.10
billyvg Sep 6, 2022
51c0298
feat: Reduce calls to `sessionStorage` when checking session life (ge…
billyvg Sep 6, 2022
7d0e4b3
v0.5.11
billyvg Sep 6, 2022
8c416f7
feat: Add feature to stop recording/plugin (getsentry/sentry-replay#172)
billyvg Sep 7, 2022
57bcb78
meta: Update README to document `destroy()` and `setup()`
billyvg Sep 7, 2022
7d6130c
fix: Clear `performanceEntries` when resetting state (getsentry/sentr…
billyvg Sep 8, 2022
9b31c01
v0.5.12
billyvg Sep 8, 2022
2361110
feat: Fix failure case in `sendReplay`, simplify `captureReplay` (get…
billyvg Sep 8, 2022
37d03f7
v0.5.13
billyvg Sep 8, 2022
b299dd1
fix: Remove console.log
billyvg Sep 9, 2022
c1cabaf
v0.5.14
billyvg Sep 9, 2022
a62fb02
fix: Ignore navigation entries with 0 duration (getsentry/sentry-repl…
billyvg Sep 12, 2022
0445763
feat: Reset initialEventTimestampSinceFlush, only track earliest even…
billyvg Sep 12, 2022
2cd90a6
feat: Change session life to 5 minutes (getsentry/sentry-replay#188)
billyvg Sep 12, 2022
9c03def
v0.5.15
billyvg Sep 12, 2022
a23992b
feat: Explicitly update session activity (getsentry/sentry-replay#192)
billyvg Sep 15, 2022
bcfd201
feat: Change flushes to be serial (getsentry/sentry-replay#193)
billyvg Sep 15, 2022
dd01dc6
v0.5.16
billyvg Sep 15, 2022
e711b88
ref: Rename flushUpdate to flush (getsentry/sentry-replay#197)
billyvg Sep 16, 2022
00c530f
feat: Do not ignore ingest host on sentry.io (getsentry/sentry-replay…
billyvg Sep 16, 2022
402bb58
fix: Sending replays retrying infinitely (getsentry/sentry-replay#201)
billyvg Sep 16, 2022
6b35bd4
meta: remove commented code
billyvg Sep 16, 2022
1ff90f2
v0.5.17
billyvg Sep 16, 2022
866b419
feat: Add option `maskAllText` to mask all text strings (getsentry/se…
billyvg Sep 19, 2022
6809350
ref: Rename defaults for privacy options (getsentry/sentry-replay#206)
billyvg Sep 19, 2022
eb8182f
ref: Rename `setup` and `destroy` methods to `start` and `stop` (gets…
billyvg Sep 19, 2022
02a62a9
Update README.md
billyvg Sep 19, 2022
552f688
v0.5.18
billyvg Sep 19, 2022
f12556b
v0.5.19
billyvg Sep 19, 2022
a111928
feat: Use `lodash.debounce` instead of custom debounce logic (getsent…
billyvg Sep 21, 2022
755d1f6
ref: Change `replay_event` timestamp (getsentry/sentry-replay#211)
billyvg Sep 21, 2022
f87674b
v0.5.20
billyvg Sep 21, 2022
f78ba4b
feat: Do not flush after console messages (getsentry/sentry-replay#212)
billyvg Sep 21, 2022
dd6fc9b
v0.5.21
billyvg Sep 21, 2022
b58c734
feat: Include sdk version when capturing events (getsentry/sentry-rep…
billyvg Sep 21, 2022
ae2800c
fix: Use scope when calling `captureEvent` (getsentry/sentry-replay#217)
billyvg Sep 22, 2022
0b92075
feat: Remove throttled flush in favor of only using debounced flush (…
billyvg Sep 23, 2022
8445683
feat: Actually de-dupe Navigation entries + take latest LCP entry (ge…
billyvg Sep 23, 2022
7fb01b5
feat: Add some debugging breadcrumbs for internal sentry users (getse…
billyvg Sep 23, 2022
4bc3985
v0.5.22
billyvg Sep 23, 2022
030f370
ref: Remove `initialEventTimestampSinceFlush` (getsentry/sentry-repla…
billyvg Sep 26, 2022
286392b
feat: Cancel `debouncedFlush` when queueing up initial flush (getsent…
billyvg Sep 26, 2022
1995dce
v0.5.23
billyvg Sep 26, 2022
1966312
ref: Rename exported integration from `SentryReplay` to `Replay` (get…
billyvg Sep 27, 2022
aea2bcc
v0.6.0
billyvg Sep 27, 2022
617703a
feat: tweak size-limit (getsentry/sentry-replay#227)
billyvg Sep 29, 2022
05313a4
feat: Make `maskAllText` default on (getsentry/sentry-replay#225)
billyvg Sep 29, 2022
1672ded
ref: Flatten configuration object (getsentry/sentry-replay#226)
billyvg Oct 5, 2022
e1f5968
docs: Fix typo that broke codeblock (getsentry/sentry-replay#233)
ryan953 Oct 11, 2022
328f743
docs: Update 'this is alpha' note (getsentry/sentry-replay#234)
ryan953 Oct 11, 2022
dc1e7d8
feat: use `browserPerformanceTimeOrigin` instead of `performance.time…
billyvg Oct 12, 2022
57b5dac
feat: Scrub all images and other various media (getsentry/sentry-repl…
billyvg Oct 12, 2022
a7fae78
docs: Change default configuration to sample at 10% (getsentry/sentry…
billyvg Oct 13, 2022
d2315a6
v0.6.1
billyvg Oct 12, 2022
d2164b7
feat: Only capture exceptions to Sentry when on "internal" apps (gets…
billyvg Oct 13, 2022
3d14c48
docs: add note about min browser SDK version (getsentry/sentry-replay…
billyvg Oct 13, 2022
c1b44af
v0.6.2
billyvg Oct 13, 2022
61ecc16
fix: Remove typescript `paths` aliases (getsentry/sentry-replay#242)
billyvg Oct 13, 2022
0891b06
v0.6.3
billyvg Oct 13, 2022
10d8ef0
feat: Throw error when class is initialized multiple times (getsentry…
billyvg Oct 17, 2022
76956f0
chore: Upgrade `jest@29` and use `node@18` (getsentry/sentry-replay#245)
billyvg Oct 18, 2022
2191b71
feat: Send replay event and segment in same envelope (getsentry/sentr…
billyvg Oct 18, 2022
ca095af
v0.6.4-0
billyvg Oct 18, 2022
6612d0d
fix: Prevent starting up if window is not defined (getsentry/sentry-r…
ryan953 Oct 19, 2022
97ffb4a
v0.6.4
billyvg Oct 19, 2022
09447d3
ref(test): use `@jest/globals` for imports (getsentry/sentry-replay#247)
billyvg Oct 19, 2022
434ad41
ci: Update deprecated `set-output` call (getsentry/sentry-replay#249)
billyvg Oct 19, 2022
f64cf6b
v0.6.5
billyvg Oct 20, 2022
ed6d7c2
bug: Prevent calling isInternal when not in the browser (getsentry/se…
ryan953 Oct 20, 2022
285ce2b
docs: Remove outdated TODO (getsentry/sentry-replay#254)
billyvg Oct 20, 2022
1ad460f
v0.6.6
billyvg Oct 21, 2022
585c8d8
feat: Filter old events (getsentry/sentry-replay#256)
billyvg Oct 24, 2022
745b581
feat: Add a maximum Session lifespan (getsentry/sentry-replay#257)
billyvg Oct 24, 2022
19df98d
v0.6.7-0
billyvg Oct 24, 2022
50da767
Prevent the multi-init error in server environments (getsentry/sentry…
ryan953 Oct 25, 2022
72b9005
v0.6.7
billyvg Oct 25, 2022
946f107
debug: Remove `runFlush` debug, change event debug (getsentry/sentry-…
billyvg Oct 25, 2022
3ddd6ef
feat: Add `flushImmediate` (getsentry/sentry-replay#260)
billyvg Oct 26, 2022
12a438e
v0.6.8
billyvg Oct 25, 2022
6a59123
v0.6.9
billyvg Oct 26, 2022
47e2693
feat: Stop recording when user is idle (getsentry/sentry-replay#261)
billyvg Oct 31, 2022
057ab13
v0.6.10-0
billyvg Oct 31, 2022
a2fef9d
docs: Add note about using `setUser` (getsentry/sentry-replay#270)
billyvg Nov 3, 2022
e96157e
Update actions/upload-artifact to v3.1.1 (getsentry/sentry-replay#266)
mattgauntseo-sentry Nov 4, 2022
178cf3f
fix: Treat sessions with `segmentId:0` as new session (getsentry/sent…
billyvg Nov 4, 2022
82fcc2f
v0.6.10
billyvg Nov 4, 2022
3302828
feat: Add errorSampleRate and continue session recording after error …
billyvg Nov 4, 2022
e2b1f91
v0.6.11-0
billyvg Nov 4, 2022
37d5cf1
fix: Remove "Session storage object with segmentId = 0" logging (gets…
ryan953 Nov 7, 2022
e26f0b2
v0.6.11
billyvg Nov 7, 2022
05d3ef1
fix: `errorSampleRate` logic when `sessionSampleRate` < 1.0 (getsentr…
billyvg Nov 7, 2022
e1d5f78
docs: Update README to say 'beta' (getsentry/sentry-replay#279)
ryan953 Nov 7, 2022
e0c1b2b
v0.6.12-0
billyvg Nov 8, 2022
0520dc9
feat: Fix initialState for error sessions (getsentry/sentry-replay#…
billyvg Nov 8, 2022
ec953cd
v0.6.13-0
billyvg Nov 8, 2022
67a604c
chore: set sessionSampleRate to 1 in demo app (getsentry/sentry-repla…
JoshFerge Nov 8, 2022
cf62137
fix: Prevent `undefined` from becoming serialized in the segment payl…
ryan953 Nov 8, 2022
011f787
v0.6.13
billyvg Nov 9, 2022
77cc6c2
feat: Update worker
billyvg Nov 9, 2022
5f7b4ac
docs: Add some quick text about sessions and sampling (getsentry/sent…
billyvg Nov 9, 2022
5adbe40
ref: Use `@sentry/core` transport instead of `fetch` directly (getsen…
billyvg Nov 9, 2022
02368bf
feat: For error replays, reset state on checkout (getsentry/sentry-r…
billyvg Nov 9, 2022
5c458ed
v0.6.14-0
billyvg Nov 9, 2022
7de8b52
build(deps): bump loader-utils from 1.4.0 to 1.4.1 in /demo (getsentr…
dependabot[bot] Nov 11, 2022
d38d348
feat: Do not tag transactions with `replayId` for error replays (gets…
billyvg Nov 11, 2022
d6893f2
v0.6.14-1
billyvg Nov 11, 2022
9ab82e5
feat: Tag sampling rates + type on replay_event (getsentry/sentry-rep…
billyvg Nov 11, 2022
364548f
v0.6.14-2
billyvg Nov 11, 2022
9c3dea0
build(js): upgrade node to latest v18 lts release (getsentry/sentry-r…
mdtro Nov 11, 2022
14f9669
ref: Refactor some test helpers (getsentry/sentry-replay#294)
billyvg Nov 14, 2022
8b9c728
docs: Min version req applies to *all* SDKs (getsentry/sentry-replay#…
jas-kas Nov 15, 2022
1a76bba
meta: Update comments for `setupOnce` (getsentry/sentry-replay#304)
billyvg Nov 15, 2022
7b48c42
feat: Remove extra `updateUserActivity` (getsentry/sentry-replay#300)
billyvg Nov 15, 2022
97512f3
meta: Format comments, remove outdated TODO
billyvg Nov 15, 2022
74f8721
replays: increment segment id after finishing buffer (getsentry/sentr…
JoshFerge Nov 15, 2022
a17b639
v0.6.14-3
billyvg Nov 15, 2022
148a90e
chore: Pin node to 14.x to align with sentry-javascript (getsentry/se…
mydea Nov 16, 2022
62c7385
chore: Update License to MIT (getsentry/sentry-replay#313)
mydea Nov 16, 2022
b2e7b5d
build(deps): bump loader-utils from 1.4.1 to 1.4.2 in /demo (getsentr…
dependabot[bot] Nov 16, 2022
d09027f
feat: Fix empty URLs on failed uploads (getsentry/sentry-replay#299)
billyvg Nov 16, 2022
35ee68b
v0.6.14-4
billyvg Nov 16, 2022
0563f18
chore: Remove husky & lint-staged (getsentry/sentry-replay#312)
mydea Nov 17, 2022
0ffa074
chore(deps): Move pako from dependency to devDependency (getsentry/se…
mydea Nov 17, 2022
e7407c8
feat: Wrap methods in try/catch (getsentry/sentry-replay#315)
billyvg Nov 17, 2022
a384ec2
v0.6.14-5
billyvg Nov 17, 2022
9a5d8c4
fix: Session storage access throws when disabled (getsentry/sentry-re…
billyvg Nov 17, 2022
563dece
v0.6.14-6
billyvg Nov 17, 2022
7301e84
Replace usage of `@jest/globals` (getsentry/sentry-replay#319)
mydea Nov 18, 2022
66571bd
v0.6.14
billyvg Nov 18, 2022
c54fd24
chore(deps): Downgrade typescript & jest to versions used in sentry-j…
mydea Nov 21, 2022
9b427b0
ref(build): Align `package.json` build scripts with JS SDK scripts (g…
Lms24 Nov 21, 2022
de845a6
ref(build): Add central `build` directory from JS SDK (getsentry/sent…
Lms24 Nov 21, 2022
a267d5f
ref: Move test files to `test/` dir (getsentry/sentry-replay#322)
mydea Nov 21, 2022
4df9f6f
chore: Update `worker.js` (pako 2.10.0) (getsentry/sentry-replay#323)
Lms24 Nov 21, 2022
02c20c0
chore: Add Prettier config
Lms24 Nov 21, 2022
ba647cc
chore: Autofix files after prettier config change
Lms24 Nov 21, 2022
44876ee
chore: Use ESLint config from `sentry-javascript`
Lms24 Nov 21, 2022
5cf29e1
chore: Apply eslint rules (or add ignores)
Lms24 Nov 22, 2022
c2e63f9
Merge branch 'lms-eslint'
Lms24 Nov 23, 2022
ee436fd
ref: Move all replay files into `packages/replay`
mydea Nov 23, 2022
3ed0d0e
ref: Move remaining root-level files into `packages/replay`
mydea Nov 23, 2022
71b308f
feat(replay): Migrate initial replay files
mydea Nov 23, 2022
fd09a4a
build(replay): Update replay dependencies
mydea Nov 23, 2022
3e85204
ref(replay): Fix linting issues
mydea Nov 23, 2022
a9d8822
ref(replay): Ignore replay from craft publishing
mydea Nov 23, 2022
4da74e8
fix(replay): Fix replay build
mydea Nov 23, 2022
7e4da3d
ref(replay): Remove unused prettier files
mydea Nov 23, 2022
0c8532b
ref(repaly): Fix E2E test config
mydea Nov 23, 2022
11dc69e
build(replay): Replay supports node 12+
mydea Nov 23, 2022
6b3d4f8
fix @rollup/plugin-typescript and yarn script problems
Lms24 Nov 23, 2022
59e433a
fix: fix rollup in replay ??
mydea Nov 23, 2022
a005fbf
ref(build): Improve tarball similarity
Lms24 Nov 24, 2022
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
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ targets:
cacheControl: 'public, max-age=31536000'
- name: github
includeNames: /^sentry-.*$/
excludeNames: /^sentry-replay-.*$/
- name: npm
excludeNames: /^sentry-replay-.*$/
- name: registry
sdks:
'npm:@sentry/browser':
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"packages/opentelemetry-node",
"packages/react",
"packages/remix",
"packages/replay",
"packages/serverless",
"packages/svelte",
"packages/tracing",
Expand All @@ -63,6 +64,7 @@
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-replace": "^3.0.1",
"@rollup/plugin-sucrase": "^4.0.3",
"@rollup/plugin-typescript": "^8.3.1",
"@size-limit/preset-small-lib": "^4.5.5",
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
"@types/chai": "^4.1.3",
Expand Down
6 changes: 6 additions & 0 deletions packages/e2e-tests/verdaccio-config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/replay':
access: $all
publish: $all
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/serverless':
access: $all
publish: $all
Expand Down
16 changes: 16 additions & 0 deletions packages/replay/.craft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
minVersion: '0.0.1'
github:
owner: getsentry
repo: sentry-replay
changelogPolicy: none
preReleaseCommand: bash scripts/craft-pre-release.sh
targets:
- name: npm
access: public
- name: github
tagPrefix: v
access: public
statusProvider:
name: github
artifactProvider:
name: github
5 changes: 5 additions & 0 deletions packages/replay/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
build/
demo/build/
# TODO: Check if we can re-introduce linting in demo
demo
124 changes: 124 additions & 0 deletions packages/replay/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// TODO: Remove this file after migration!
// TODO: Remove Sentry ESLint config package from package.json
// Note: All paths are relative to the directory in which eslint is being run, rather than the directory where this file
// lives

// ESLint config docs: https://eslint.org/docs/user-guide/configuring/

module.exports = {
root: true,
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
},
extends: ['@sentry-internal/sdk'],
ignorePatterns: [
'coverage/**',
'build/**',
'dist/**',
'cjs/**',
'esm/**',
'examples/**',
'test/manual/**',
'types/**',
// TODO: Remove these after migration
'scripts/**',
'config/**',
'config/**',
'__mocks__/**',
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.d.ts'],
parserOptions: {
project: ['tsconfig.json'],
},
},
// TODO: Extract this to package-specific config after mgiration
{
files: ['worker/**/*.ts'],
parserOptions: {
project: ['config/tsconfig.worker.json'],
},
},
{
files: ['*.ts', '*.tsx', '*.d.ts'],
rules: {
// TODO (high-prio): Go through console logs and figure out which ones should be replaced with the SDK logger
'no-console': 'off',
// TODO (high-pio): Re-enable this after migration
'no-restricted-globals': 'off',
// TODO (high-prio): Re-enable this after migration
'@typescript-eslint/explicit-member-accessibility': 'off',
// TODO (high-prio): Remove this exception from naming convention after migration
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'memberLike',
modifiers: ['protected'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
],
// TODO (high-prio): Re-enable this after migration
'@sentry-internal/sdk/no-async-await': 'off',
// TODO (high-prio): Re-enable this after migration
'@typescript-eslint/no-floating-promises': 'off',
// TODO (medium-prio): Re-enable this after migration
'jsdoc/require-jsdoc': 'off',
// TODO: Do we even want to turn this on? Why not enable ++?
'no-plusplus': 'off',
},
},
{
files: ['jest.setup.ts'],
rules: {
'no-console': 'off',
},
},
{
files: ['test/**/*.ts'],
rules: {
// TODO: decide if we want to keep our '@test' import paths
'import/no-unresolved': 'off',
// most of these errors come from `new Promise(process.nextTick)`
'@typescript-eslint/unbound-method': 'off',
// TODO: decide if we want to enable this again after the migration
// We can take the freedom to be a bit more lenient with tests
'@typescript-eslint/no-floating-promises': 'off',
},
},
{
files: ['src/worker/**/*.js'],
parserOptions: {
sourceType: 'module',
},
},
// ----------------
{
files: ['*.tsx'],
rules: {
// Turn off jsdoc on tsx files until jsdoc is fixed for tsx files
// See: https://github.com/getsentry/sentry-javascript/issues/3871
'jsdoc/require-jsdoc': 'off',
},
},
{
files: ['scenarios/**', 'rollup/**'],
parserOptions: {
sourceType: 'module',
},
rules: {
'no-console': 'off',
},
},
],
};
5 changes: 5 additions & 0 deletions packages/replay/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
/*.tgz
.eslintcache
dist
build
3 changes: 3 additions & 0 deletions packages/replay/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TODO after we migrated, we should revisit this file and check if we can use the monorepo's master
# .npmigore file or if we should add custom entries here.
# For the time being, this can stay empty.
14 changes: 14 additions & 0 deletions packages/replay/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (c) 2022 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
155 changes: 155 additions & 0 deletions packages/replay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# sentry-replay

Note: Session Replay is currently in beta.

## Pre-requisites

For the sentry-replay integration to work, you must have the [Sentry browser SDK package](https://www.npmjs.com/package/@sentry/browser), or an equivalent framework SDK (e.g. [@sentry/react](https://www.npmjs.com/package/@sentry/react)) installed. The minimum version required for the SDK is `7.x`.


`@sentry/replay` requires Node 12+, and browsers newer than IE11.

## Installation

with npm:

```shell
npm install --save @sentry/browser @sentry/replay
```

with yarn:

```shell
yarn add @sentry/browser @sentry/replay
```

## Setup

To set up the integration, add the following to your Sentry initialization. Several options are supported and passable via the integration constructor.
See the [configuration section](#configuration) below for more details.

```javascript
import * as Sentry from '@sentry/browser';
import { Replay } from '@sentry/replay';

Sentry.init({
dsn: '__DSN__',
integrations: [
new Replay({
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
sessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
errorSampleRate: 1.0,

// Mask all text content with asterisks (*). Passes text
// content through to `maskTextFn` before sending to server.
//
// Defaults to true, uncomment to change
// maskAllText: true,

// Block all media elements (img, svg, video, object,
// picture, embed, map, audio)
//
// Defaults to true, uncomment to change
// blockAllMedia: true,
})
],
// ...
});
```

### Identifying Users

If you have only followed the above instructions to setup session replays, you will only see IP addresses in Sentry's UI. In order to associate a user identity to a session replay, use [`setUser`](https://docs.sentry.io/platforms/javascript/enriching-events/identify-user/).

```javascript
import * as Sentry from "@sentry/browser";
Sentry.setUser({ email: "[email protected]" });
```

### Start and Stop Recording

Replay recording only starts automatically when it is included in the `integrations` key when calling `Sentry.init`. Otherwise you can initialize the plugin and manually call the `start()` method on the integration instance. To stop recording you can call the `stop()`.

```javascript
const replay = new Replay(); // This will *NOT* begin recording replays

replay.start(); // Start recording

replay.stop(); // Stop recording
```

## Sessions

A session starts when the Session Replay SDK is first loaded and initialized. The session will continue until 5 minutes passes without any user interactions[^1] with the application *OR* until a maximum of 30 minutes have elapsed. Closing the browser tab will end the session immediately according to the rules for [SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).

[^1]: An 'interaction' refers to either a mouse click or a browser navigation event.

### Replay Captures Only on Errors

Alternatively, rather than recording an entire session, you can capture a replay only when an error occurs. In this case, the integration will buffer up to one minute worth of events prior to the error being thrown. It will continue to record the session following the rules above regarding session life and activity. Read the [sampling](#Sampling) section for configuration options.

## Sampling

Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays more relevant to your interests:

- `sessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the user's session.
- `errorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends.

Sampling occurs when the session is first started. `sessionSampleRate` is evaluated first. If it is sampled, then the replay recording begins. Otherwise, `errorSampleRate` is evaluated and if it is sampled, the integration will begin buffering the replay and will only upload a replay to Sentry when an error occurs. The remainder of the replay will behave similarly to a whole-session replay.


## Configuration

### General Configuration

| key | type | default | description |
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sessionSampleRate | number | `0.1` | The sample rate for all sessions, which will capture the entirety from when a user begins a session until the session ends. (1.0 will collect all replays, 0 will collect no replays) |
| errorSampleRate | number | `1.0` | If a session isn't already being recorded via `sessionSampleRate`, based on `errorSampleRate` the SDK will send the captured replay when an error occurs. (1.0 capturing all sessions with an error, and 0 capturing none). |
| stickySession | boolean | `true` | Keep track of the user across page loads. Note a single user using multiple tabs will result in multiple sessions. Closing a tab will result in the session being closed as well. |

### Privacy Configuration

| key | type | default | description |
| ---------------- | ------------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskTextFn` before sending to server. |
| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`)
| maskTextFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how text content is masked before sending to server. By default, masks text with `*`. |
| maskAllInputs | boolean | `true` | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server. |
| maskInputOptions | Record<string, boolean> | `{ password: true }` | Customize which inputs `type` to mask. <br /> Available `<input>` types: `color, date, datetime-local, email, month, number, range, search, tel, text, time, url, week, textarea, select, password`. |
| maskInputFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how form input values are masked before sending to server. By default, masks values with `*`. |
| blockClass | string \| RegExp | `'sentry-block'` | Redact all elements that match the class name. See [privacy](#blocking) section for an example. |
| blockSelector | string | `'[data-sentry-block]'` | Redact all elements that match the DOM selector. See [privacy](#blocking) section for an example. |
| ignoreClass | string \| RegExp | `'sentry-ignore'` | Ignores all events on the matching input field. See [privacy](#ignoring) section for an example. |
| maskTextClass | string \| RegExp | `'sentry-mask'` | Mask all elements that match the class name. See [privacy](#masking) section for an example. |

### Optimization Configuration

| key | type | default | description |
| ---------------- | ----------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| collectFonts | boolean | `false` | Should collect fonts used on the website |
| inlineImages | boolean | `false` | Should inline `<image>` content |
| inlineStylesheet | boolean | `true` | Should inline stylesheets used in the recording |
| recordCanvas | boolean | `false` | Should record `<canvas>` elements |
| slimDOMOptions | Record<string, boolean> | `{}` | Remove unnecessary parts of the DOM <br /> Available keys: `script, comment, headFavicon, headWhitespace, headMetaDescKeywords, headMetaSocial, headMetaRobots, headMetaHttpEquiv, headMetaAuthorship, headMetaVerification` |

## Privacy
There are several ways to deal with PII. By default, the integration will mask all text content with `*` and block all media elements (`img, svg, video, object, picture, embed, map, audio`). This can be disabled by setting `maskAllText` to `false`. It is also possible to add the following CSS classes to specific DOM elements to prevent recording its contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content is handled by the differing methods.

### Masking
Masking replaces the text content with something else. The default masking behavior is to replace each character with a `*`. In this example the relevant html code is: `<table class="sentry-mask">...</table>`.
![Masking example](https://user-images.githubusercontent.com/79684/193118192-dee1d3d8-5813-47e8-b532-f9ee1c8714b3.png)

### Blocking
Blocking replaces the element with a placeholder that has the same dimensions. The recording will show an empty space where the content was. In this example the relevant html code is: `<table data-sentry-block>...</table>`.
![Blocking example](https://user-images.githubusercontent.com/79684/193118084-51a589fc-2160-476a-a8dc-b681eddb136c.png)

### Ignoring
Ignoring only applies to form inputs. Events will be ignored on the input element so that the replay does not show what occurs inside of the input. In the below example, notice how the results in the table below the input changes, but no text is visible in the input.

https://user-images.githubusercontent.com/79684/192815134-a6451c3f-d3cb-455f-a699-7c3fe04d0a2e.mov

12 changes: 12 additions & 0 deletions packages/replay/__mocks__/@sentry/browser/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const captureEvent = jest.fn();
const getCurrentHub = jest.fn(() => ({
captureEvent,
getClient: jest.fn(() => ({
getDsn: jest.fn(),
})),
}));

const addGlobalEventProcessor = jest.fn();
const configureScope = jest.fn();

export { getCurrentHub, addGlobalEventProcessor, configureScope };
Loading