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

capture response body for failed requests and if tracing is enabled in SentryHttpClient #2293

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

martinhaintz
Copy link
Collaborator

@martinhaintz martinhaintz commented Sep 16, 2024

📜 Description

If sendDefaultPii is enabled and maxResponseBodySize is bigger than the responseBodySize, the body is logged in sentry.

💡 Motivation and Context

close #2220

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Sep 16, 2024

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- capture response body for failed requests and if tracing is enabled in SentryHttpClient ([#2293](https://github.com/getsentry/sentry-dart/pull/2293))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against da865b2

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.93%. Comparing base (16063b2) to head (da865b2).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2293      +/-   ##
==========================================
- Coverage   88.35%   86.93%   -1.42%     
==========================================
  Files         247      104     -143     
  Lines        8578     3713    -4865     
==========================================
- Hits         7579     3228    -4351     
+ Misses        999      485     -514     

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

Copy link
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1231.69 ms 1256.85 ms 25.16 ms
Size 8.38 MiB 9.73 MiB 1.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d8f5abb 1237.73 ms 1259.13 ms 21.39 ms
f275487 1291.65 ms 1339.92 ms 48.26 ms
fcd1ee4 1247.18 ms 1251.35 ms 4.16 ms
f7f46dc 1285.82 ms 1315.06 ms 29.24 ms
ba9c106 1241.76 ms 1265.15 ms 23.40 ms
77db8d4 1228.47 ms 1248.80 ms 20.33 ms
ccc09e4 1254.74 ms 1277.08 ms 22.34 ms
dd933d4 1238.73 ms 1252.43 ms 13.70 ms
d883d62 1221.39 ms 1230.18 ms 8.80 ms
6034b0a 1244.89 ms 1270.22 ms 25.33 ms

App size

Revision Plain With Sentry Diff
d8f5abb 8.33 MiB 9.40 MiB 1.07 MiB
f275487 8.32 MiB 9.38 MiB 1.05 MiB
fcd1ee4 8.29 MiB 9.36 MiB 1.07 MiB
f7f46dc 8.10 MiB 9.17 MiB 1.08 MiB
ba9c106 8.32 MiB 9.38 MiB 1.06 MiB
77db8d4 8.38 MiB 9.73 MiB 1.35 MiB
ccc09e4 8.16 MiB 9.16 MiB 1.01 MiB
dd933d4 8.33 MiB 9.64 MiB 1.31 MiB
d883d62 8.29 MiB 9.36 MiB 1.07 MiB
6034b0a 8.33 MiB 9.40 MiB 1.07 MiB

Comment on lines +282 to 283
"All Request and Responses are now logged, if `sendDefaultPii` is `true` and `maxRequestBodySize` and `maxResponseBodySize` conditions are met.")
bool captureFailedRequests = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

let's rethink this, I don't think deprecating this flag is the right way to go

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.

Capture HTTP Response Body for SentryHttpClient
2 participants