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

ref: Stops session replay if rate limiting is activated #4496

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

brustolin
Copy link
Contributor

📜 Description

Stop session replay if the app is being rate limited.

💡 Motivation and Context

https://github.com/getsentry/team-replay/issues/496

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 99.31973% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.462%. Comparing base (ed470cf) to head (0f63554).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Sentry/SentrySessionReplayIntegration.m 93.333% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4496       +/-   ##
=============================================
+ Coverage   91.439%   91.462%   +0.022%     
=============================================
  Files          616       615        -1     
  Lines        68794     68976      +182     
  Branches     24677     24755       +78     
=============================================
+ Hits         62905     63087      +182     
- Misses        5796      5797        +1     
+ Partials        93        92        -1     
Files with missing lines Coverage Δ
Sources/Sentry/SentryClient.m 98.680% <100.000%> (ø)
Sources/Sentry/SentryDependencyContainer.m 96.710% <100.000%> (+0.194%) ⬆️
Sources/Sentry/SentryTransportFactory.m 100.000% <ø> (ø)
...onReplay/SentrySessionReplayIntegrationTests.swift 99.173% <100.000%> (+0.215%) ⬆️
...Tests/Networking/SentryTransportFactoryTests.swift 100.000% <100.000%> (ø)
...s/Networking/SentryTransportInitializerTests.swift 100.000% <100.000%> (ø)
Sources/Sentry/SentrySessionReplayIntegration.m 86.432% <93.333%> (+0.531%) ⬆️

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed470cf...0f63554. Read the comment docs.

Copy link

github-actions bot commented Nov 4, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1232.23 ms 1248.06 ms 15.83 ms
Size 21.90 KiB 727.76 KiB 705.86 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
1223af7 1212.84 ms 1227.49 ms 14.65 ms
b1b7d72 1246.31 ms 1261.00 ms 14.69 ms
f715499 1234.26 ms 1259.40 ms 25.14 ms
676e429 1225.76 ms 1235.49 ms 9.73 ms
1656cf6 1229.59 ms 1245.52 ms 15.93 ms
48e8c2e 1226.45 ms 1246.85 ms 20.41 ms
46c6025 1213.87 ms 1253.06 ms 39.19 ms
59c1b97 1230.70 ms 1257.12 ms 26.42 ms
270b57d 1220.08 ms 1240.06 ms 19.98 ms
ee3f02e 1236.53 ms 1263.54 ms 27.01 ms

App size

Revision Plain With Sentry Diff
1223af7 21.90 KiB 726.19 KiB 704.29 KiB
b1b7d72 20.76 KiB 436.33 KiB 415.57 KiB
f715499 20.76 KiB 427.23 KiB 406.47 KiB
676e429 21.58 KiB 614.73 KiB 593.15 KiB
1656cf6 21.58 KiB 546.19 KiB 524.61 KiB
48e8c2e 21.58 KiB 418.44 KiB 396.86 KiB
46c6025 22.85 KiB 408.84 KiB 385.99 KiB
59c1b97 21.58 KiB 547.63 KiB 526.05 KiB
270b57d 21.58 KiB 542.28 KiB 520.70 KiB
ee3f02e 22.84 KiB 401.67 KiB 378.83 KiB

Previous results on branch: feat/sr-rate-limiting

Startup times

Revision Plain With Sentry Diff
4d4414e 1232.29 ms 1242.15 ms 9.86 ms
7ad8be4 1213.36 ms 1230.11 ms 16.74 ms

App size

Revision Plain With Sentry Diff
4d4414e 21.90 KiB 726.88 KiB 704.98 KiB
7ad8be4 21.90 KiB 726.56 KiB 704.66 KiB

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

I would rather check the active rate limits than having a flag.

Sources/Sentry/SentryReachability.m Outdated Show resolved Hide resolved
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, when adding a comment why we rate limit until the next session.

@brustolin brustolin merged commit 8fb1a4a into main Nov 7, 2024
45 of 46 checks passed
@brustolin brustolin deleted the feat/sr-rate-limiting branch November 7, 2024 10:00
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.

2 participants