-
-
Notifications
You must be signed in to change notification settings - Fork 464
feat(replay): Capture network request/response details when using SentryOkHttpListener #4919
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
667e61a
Use case-insensitive comparision when extracting headers
43jay 83a1903
Extract network details when using SentryOkHttpEventListener
43jay a3ecf3b
CHANGELOG for Network Details extraction
43jay 707eed4
unit tests
43jay 90a1e0a
Format code
getsentry-bot a5e6d65
bug: fix NullPointerException if allowedHeaders contains null
43jay 7098121
bug: fix Duplicate HTTP headers lost in conversion
43jay 24d0cbb
bug: fix Set-Cookie headers incorrectly concatenated with comma separโฆ
43jay a4dd41c
Update CHANGELOG.md based on review feedback
43jay f75c4f9
1/2 Respect default Locale when lowercasing header strings
43jay 896654c
2/2 Respect default Locale when lowercasing header strings
43jay af55d73
3/2 Respect default Locale when lowercasing header strings
43jay 1dd5ecf
Add code sample to CHANGELOG
43jay b8ee888
Update API to accept List<String> everywhere
43jay d3114de
Format code
getsentry-bot a151c5b
rebase
43jay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,55 @@ | |
|
|
||
| ## Unreleased | ||
|
|
||
| ### Features | ||
|
|
||
| - Add option to capture additional OkHttp network request/response details in session replays ([#4919](https://github.com/getsentry/sentry-java/pull/4919)) | ||
| - Depends on `SentryOkHttpInterceptor` to intercept the request and extract request/response bodies | ||
| - To enable, add url regexes via the `io.sentry.session-replay.network-detail-allow-urls` metadata tag in AndroidManifest ([code sample](https://github.com/getsentry/sentry-java/blob/b03edbb1b0d8b871c62a09bc02cbd8a4e1f6fea1/sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml#L196-L205)) | ||
| - Or you can manually specify SentryReplayOptions via `SentryAndroid#init`: | ||
| _(Make sure you disable the auto init via manifest meta-data: io.sentry.auto-init=false)_ | ||
|
|
||
| <details> | ||
| <summary>Kotlin</summary> | ||
|
|
||
| ```kotlin | ||
| SentryAndroid.init( | ||
| this, | ||
| options -> { | ||
| // options.dsn = "https://[email protected]/0" | ||
| // options.sessionReplay.sessionSampleRate = 1.0 | ||
| // options.sessionReplay.onErrorSampleRate = 1.0 | ||
| // .. | ||
|
|
||
| options.sessionReplay.networkDetailAllowUrls = listOf(".*") | ||
| options.sessionReplay.networkDetailDenyUrls = listOf(".*deny.*") | ||
| options.sessionReplay.networkRequestHeaders = listOf("Authorization", "X-Custom-Header", "X-Test-Request") | ||
| options.sessionReplay.networkResponseHeaders = listOf("X-Response-Time", "X-Cache-Status", "X-Test-Response") | ||
| }); | ||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
| <details> | ||
| <summary>Java</summary> | ||
|
|
||
| ```java | ||
| SentryAndroid.init( | ||
| this, | ||
| options -> { | ||
| options.getSessionReplay().setNetworkDetailAllowUrls(Arrays.asList(".*")); | ||
| options.getSessionReplay().setNetworkDetailDenyUrls(Arrays.asList(".*deny.*")); | ||
| options.getSessionReplay().setNetworkRequestHeaders( | ||
| Arrays.asList("Authorization", "X-Custom-Header", "X-Test-Request")); | ||
| options.getSessionReplay().setNetworkResponseHeaders( | ||
| Arrays.asList("X-Response-Time", "X-Cache-Status", "X-Test-Response")); | ||
| }); | ||
|
|
||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
|
|
||
| ### Improvements | ||
|
|
||
| - Avoid forking `rootScopes` for Reactor if current thread has `NoOpScopes` ([#4793](https://github.com/getsentry/sentry-java/pull/4793)) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.