Skip to content

Set HTTP client breadcrumbs log level based on response status code #2847

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 13 commits into from
Apr 15, 2025

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Apr 8, 2025

getsentry/team-sdks#100

Closes #2689

Note: the package-analysis CI failures are currently expected

Copy link
Contributor

github-actions bot commented Apr 8, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 6a2fb7d

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.61%. Comparing base (213fb39) to head (6a2fb7d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2847   +/-   ##
=======================================
  Coverage   87.61%   87.61%           
=======================================
  Files         270      271    +1     
  Lines        9032     9037    +5     
=======================================
+ Hits         7913     7918    +5     
  Misses       1119     1119           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Apr 8, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 498.22 ms 555.33 ms 57.11 ms
Size 6.44 MiB 7.43 MiB 1010.28 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d61cecf 339.69 ms 387.57 ms 47.88 ms
a609134 350.12 ms 404.12 ms 54.00 ms
6491ebd 301.74 ms 351.96 ms 50.22 ms
d0312c9 354.78 ms 411.53 ms 56.75 ms
c73ab67 353.82 ms 408.71 ms 54.90 ms
1bbb79f 453.04 ms 490.74 ms 37.70 ms
294b7f0 367.83 ms 430.00 ms 62.17 ms
7b34d99 441.92 ms 481.40 ms 39.48 ms
21845e2 345.08 ms 382.82 ms 37.74 ms
be1723a 453.86 ms 493.64 ms 39.78 ms

App size

Revision Plain With Sentry Diff
d61cecf 6.06 MiB 7.03 MiB 995.56 KiB
a609134 5.94 MiB 6.95 MiB 1.01 MiB
6491ebd 6.15 MiB 7.13 MiB 999.96 KiB
d0312c9 6.33 MiB 7.26 MiB 949.76 KiB
c73ab67 6.15 MiB 7.13 MiB 999.97 KiB
1bbb79f 6.49 MiB 7.57 MiB 1.08 MiB
294b7f0 6.33 MiB 7.26 MiB 950.21 KiB
7b34d99 6.44 MiB 7.50 MiB 1.06 MiB
21845e2 5.94 MiB 6.92 MiB 1003.77 KiB
be1723a 6.49 MiB 7.56 MiB 1.07 MiB

Previous results on branch: feat/log-level-http-response

Startup times

Revision Plain With Sentry Diff
f766e3c 471.24 ms 550.65 ms 79.41 ms
840b083 473.80 ms 528.81 ms 55.00 ms
1afee02 475.02 ms 520.29 ms 45.26 ms
79f8d58 457.74 ms 530.94 ms 73.20 ms
b5e25f2 430.71 ms 496.90 ms 66.18 ms
a3bed6e 444.35 ms 503.88 ms 59.53 ms

App size

Revision Plain With Sentry Diff
f766e3c 6.44 MiB 7.43 MiB 1007.27 KiB
840b083 6.44 MiB 7.43 MiB 1007.27 KiB
1afee02 6.44 MiB 7.43 MiB 1010.28 KiB
79f8d58 6.44 MiB 7.43 MiB 1007.62 KiB
b5e25f2 6.44 MiB 7.43 MiB 1007.61 KiB
a3bed6e 6.44 MiB 7.43 MiB 1010.28 KiB

Copy link
Contributor

github-actions bot commented Apr 8, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1248.78 ms 1270.00 ms 21.22 ms
Size 8.43 MiB 10.00 MiB 1.57 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e2d89fc 1251.80 ms 1261.92 ms 10.11 ms
ed605cc 1246.06 ms 1262.04 ms 15.98 ms
c57d3b7 1249.92 ms 1280.31 ms 30.39 ms
ea1d45d 1234.96 ms 1250.27 ms 15.31 ms
c328ffc 1236.73 ms 1260.73 ms 24.00 ms
6fedcab 1242.33 ms 1269.66 ms 27.33 ms
3500574 1263.02 ms 1263.73 ms 0.71 ms
95c69e3 1223.94 ms 1245.29 ms 21.35 ms
ec4c9da 1228.33 ms 1261.63 ms 33.31 ms
00236a7 1250.06 ms 1274.00 ms 23.94 ms

App size

Revision Plain With Sentry Diff
e2d89fc 8.10 MiB 9.16 MiB 1.06 MiB
ed605cc 8.10 MiB 9.17 MiB 1.08 MiB
c57d3b7 8.32 MiB 9.52 MiB 1.20 MiB
ea1d45d 8.42 MiB 9.97 MiB 1.54 MiB
c328ffc 8.34 MiB 9.67 MiB 1.33 MiB
6fedcab 8.32 MiB 9.50 MiB 1.18 MiB
3500574 8.29 MiB 9.38 MiB 1.09 MiB
95c69e3 8.33 MiB 9.64 MiB 1.31 MiB
ec4c9da 8.38 MiB 9.71 MiB 1.34 MiB
00236a7 8.38 MiB 9.77 MiB 1.39 MiB

Previous results on branch: feat/log-level-http-response

Startup times

Revision Plain With Sentry Diff
79f8d58 1258.27 ms 1281.12 ms 22.86 ms
840b083 1249.65 ms 1261.43 ms 11.78 ms
a3bed6e 1248.02 ms 1263.04 ms 15.02 ms
b5e25f2 1265.90 ms 1278.82 ms 12.92 ms
f766e3c 1259.86 ms 1262.31 ms 2.45 ms

App size

Revision Plain With Sentry Diff
79f8d58 8.43 MiB 9.99 MiB 1.56 MiB
840b083 8.43 MiB 9.99 MiB 1.56 MiB
a3bed6e 8.43 MiB 10.00 MiB 1.57 MiB
b5e25f2 8.43 MiB 9.99 MiB 1.56 MiB
f766e3c 8.43 MiB 9.99 MiB 1.56 MiB

@buenaflor buenaflor marked this pull request as ready for review April 9, 2025 14:51
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, thanks for adding this.

/// Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code.
@internal
SentryLevel? getBreadcrumbLogLevelFromHttpStatusCode(int statusCode) {
// NOTE: null defaults to 'info' in Sentry
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the comment.

@buenaflor buenaflor merged commit 8183af1 into main Apr 15, 2025
158 of 164 checks passed
@buenaflor buenaflor deleted the feat/log-level-http-response branch April 15, 2025 11:46
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.

Set HTTP client breadcrumbs log level based on response status code
2 participants