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): Add more default block filters #7233

Merged
merged 12 commits into from Feb 22, 2023

Conversation

lucas-zimerman
Copy link
Contributor

@lucas-zimerman lucas-zimerman commented Feb 20, 2023

This adds the following block filters:

  • link[rel="icon"] (Browser icon)
  • link[rel="apple-touch-icon"]' (Browser icon)
  • base[href="/"]

The link icons could be removed since they're not visible from the Sentry Replay UI.
The base href is removing the localhost references that causes CSP errors at Sentry as seen here #7184 and here #7183 (comment)

The base[href="/"] filter makes sense for apps that are using Sentry/Javascript since the tools usually adds a localhost reference and that causes the Sentry Website to have CSP errors.

Additionally, I have validated it locally with the Replay Sample/Demo but I am unsure how should I add tests for those items.
Before submitting a pull request, please take a look at our

Maybe in the future, consider adding ways for sibling SDKs to add additional block parameters so that the main Replay doesn't include filters from platform specific code.
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
    (Yarn test is not passing locally because the machine is running out of memory and there's a test that seems to be time sensitive)

@github-actions
Copy link
Contributor

Replay SDK metrics 🚀

    Plain +Sentry +Replay
Revision Value Value Diff Ratio Value Diff Ratio
LCP This PR b04a6d4 92.09 ms 131.97 ms +39.88 ms +43.31 % 165.95 ms +73.86 ms +80.21 %
Previous 12e34d4 120.79 ms 144.24 ms +23.45 ms +19.42 % 149.36 ms +28.57 ms +23.65 %
CLS This PR b04a6d4 0.06 ms 0.06 ms -0.00 ms -0.41 % 0.06 ms -0.00 ms -0.25 %
Previous 12e34d4 0.06 ms 0.06 ms -0.00 ms -0.10 % 0.06 ms +0.00 ms +0.09 %
CPU This PR b04a6d4 23.24 % 23.59 % +0.35 pp +1.50 % 31.96 % +8.73 pp +37.55 %
Previous 12e34d4 25.72 % 25.96 % +0.24 pp +0.93 % 31.49 % +5.77 pp +22.42 %
JS heap avg This PR b04a6d4 1.94 MB 2.05 MB +115.42 kB +5.96 % 2.87 MB +932.01 kB +48.14 %
Previous 12e34d4 1.94 MB 2.06 MB +116.91 kB +6.03 % 2.87 MB +930.12 kB +47.96 %
JS heap max This PR b04a6d4 2.3 MB 2.58 MB +278.5 kB +12.10 % 3.36 MB +1.05 MB +45.76 %
Previous 12e34d4 2.32 MB 2.58 MB +259.14 kB +11.17 % 3.36 MB +1.04 MB +44.66 %
netTx This PR b04a6d4 0 B 0 B 0 B n/a 2.21 kB +2.21 kB n/a
Previous 12e34d4 0 B 0 B 0 B n/a 2.26 kB +2.26 kB n/a
netRx This PR b04a6d4 0 B 0 B 0 B n/a 41 B +41 B n/a
Previous 12e34d4 0 B 0 B 0 B n/a 41 B +41 B n/a
netCount This PR b04a6d4 0 0 0 n/a 1 +1 n/a
Previous 12e34d4 0 0 0 n/a 1 +1 n/a
netTime This PR b04a6d4 0.00 ms 0.00 ms 0.00 ms n/a 127.27 ms +127.27 ms n/a
Previous 12e34d4 0.00 ms 0.00 ms 0.00 ms n/a 109.67 ms +109.67 ms n/a

Previous results on branch: develop

RevisionLCPCLSCPUJS heap avgJS heap maxnetTxnetRxnetCountnetTime
12e34d4+28.57 ms+0.00 ms+5.77 pp+930.12 kB+1.04 MB+2.26 kB+41 B+1+109.67 ms
c46c56c+65.45 ms-0.00 ms+5.38 pp+930.26 kB+1.07 MB+2.21 kB+41 B+1+91.29 ms
7f4c4ec+56.64 ms-0.00 ms+5.57 pp+927.42 kB+1.06 MB+2.21 kB+41 B+1+110.83 ms
00d2360+55.18 ms+0.00 ms+2.23 pp+934.14 kB+1.05 MB+2.22 kB+41 B+1+71.65 ms

*) pp - percentage points - an absolute difference between two percentages.
Last updated: Mon, 20 Feb 2023 15:38:22 GMT

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks a lot! 🚀

@mydea
Copy link
Member

mydea commented Feb 21, 2023

Ah, some tests are failing - can you take a look at fixing them? if not or if unsure where to look, let me know, then I'll see when I get to it!

@lucas-zimerman
Copy link
Contributor Author

lucas-zimerman commented Feb 21, 2023

Ah, some tests are failing - can you take a look at fixing them? if not or if unsure where to look, let me know, then I'll see when I get to it!

Not entirely sure if tests will pass (my machine keeps dying during tests 😅) but I fixed some of them (I believe if there's any issue it may be related to the outdated snapshot) If tests fail I'll fix it tomorrow : )

@mydea mydea changed the title fix(replay): Additional block filters feat(replay): Additional block filters Feb 22, 2023
@lucas-zimerman
Copy link
Contributor Author

@mydea Tests are now fixed : )

@mydea mydea changed the title feat(replay): Additional block filters feat(replay): Add more default block filters Feb 22, 2023
@mydea mydea merged commit e60cd02 into getsentry:develop Feb 22, 2023
@mydea
Copy link
Member

mydea commented Feb 22, 2023

Thanks a lot! I promoted this to a feat, as it's actually an improvement. Will go out in the next release - thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants