You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4742e23
Browse filesBrowse the repository at this point in the historyBrowse files
feat(replay): Capture network request/response details when using SentryOkHttpListener (#4919)
* Extract NetworkRequestData into Breadcrumb Hint when using SentryOkHttpEventListener
-> Reuse existing logic that retrieves optional SentryOkHttpEvent for the okhttp3.Call, and optionally provide NetworkRequestData for adding to Breadcrumb Hint in SentryOkHttpEvent#finish
Couple related changes as well:
* Use case-insensitive comparision when extracting headers
* Update SentryReplayOptions network request/response API to accept List<String> everywhere
* CHANGELOG for Network Details extraction
Copy file name to clipboardExpand all lines: CHANGELOG.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,55 @@
2
2
3
3
## Unreleased
4
4
5
+
### Features
6
+
7
+
- Add option to capture additional OkHttp network request/response details in session replays ([#4919](https://github.com/getsentry/sentry-java/pull/4919))
8
+
- Depends on `SentryOkHttpInterceptor` to intercept the request and extract request/response bodies
9
+
- 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))
10
+
- Or you can manually specify SentryReplayOptions via `SentryAndroid#init`:
11
+
_(Make sure you disable the auto init via manifest meta-data: io.sentry.auto-init=false)_
Copy file name to clipboardExpand all lines: sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/TriggerHttpRequestActivity.java
Copy file name to clipboardExpand all lines: sentry/api/sentry.api
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -3801,11 +3801,11 @@ public final class io/sentry/SentryReplayOptions {
3801
3801
public fun getFrameRate ()I
3802
3802
public fun getMaskViewClasses ()Ljava/util/Set;
3803
3803
public fun getMaskViewContainerClass ()Ljava/lang/String;
3804
-
public fun getNetworkDetailAllowUrls ()[Ljava/lang/String;
3805
-
public fun getNetworkDetailDenyUrls ()[Ljava/lang/String;
3804
+
public fun getNetworkDetailAllowUrls ()Ljava/util/List;
3805
+
public fun getNetworkDetailDenyUrls ()Ljava/util/List;
3806
3806
public static fun getNetworkDetailsDefaultHeaders ()Ljava/util/List;
3807
-
public fun getNetworkRequestHeaders ()[Ljava/lang/String;
3808
-
public fun getNetworkResponseHeaders ()[Ljava/lang/String;
3807
+
public fun getNetworkRequestHeaders ()Ljava/util/List;
3808
+
public fun getNetworkResponseHeaders ()Ljava/util/List;
3809
3809
public fun getOnErrorSampleRate ()Ljava/lang/Double;
3810
3810
public fun getQuality ()Lio/sentry/SentryReplayOptions$SentryReplayQuality;
3811
3811
public fun getScreenshotStrategy ()Lio/sentry/ScreenshotStrategyType;
@@ -3825,8 +3825,8 @@ public final class io/sentry/SentryReplayOptions {
3825
3825
public fun setMaskAllText (Z)V
3826
3826
public fun setMaskViewContainerClass (Ljava/lang/String;)V
3827
3827
public fun setNetworkCaptureBodies (Z)V
3828
-
public fun setNetworkDetailAllowUrls ([Ljava/lang/String;)V
3829
-
public fun setNetworkDetailDenyUrls ([Ljava/lang/String;)V
3828
+
public fun setNetworkDetailAllowUrls (Ljava/util/List;)V
3829
+
public fun setNetworkDetailDenyUrls (Ljava/util/List;)V
3830
3830
public fun setNetworkRequestHeaders (Ljava/util/List;)V
3831
3831
public fun setNetworkResponseHeaders (Ljava/util/List;)V
3832
3832
public fun setOnErrorSampleRate (Ljava/lang/Double;)V
@@ -7496,9 +7496,9 @@ public final class io/sentry/util/network/NetworkBodyParser {
7496
7496
}
7497
7497
7498
7498
public final class io/sentry/util/network/NetworkDetailCaptureUtils {
7499
-
public static fun createRequest (Ljava/lang/Object;Ljava/lang/Long;ZLio/sentry/util/network/NetworkDetailCaptureUtils$NetworkBodyExtractor;[Ljava/lang/String;Lio/sentry/util/network/NetworkDetailCaptureUtils$NetworkHeaderExtractor;)Lio/sentry/util/network/ReplayNetworkRequestOrResponse;
7500
-
public static fun createResponse (Ljava/lang/Object;Ljava/lang/Long;ZLio/sentry/util/network/NetworkDetailCaptureUtils$NetworkBodyExtractor;[Ljava/lang/String;Lio/sentry/util/network/NetworkDetailCaptureUtils$NetworkHeaderExtractor;)Lio/sentry/util/network/ReplayNetworkRequestOrResponse;
7501
-
public static fun initializeForUrl (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)Lio/sentry/util/network/NetworkRequestData;
7499
+
public static fun createRequest (Ljava/lang/Object;Ljava/lang/Long;ZLio/sentry/util/network/NetworkDetailCaptureUtils$NetworkBodyExtractor;Ljava/util/List;Lio/sentry/util/network/NetworkDetailCaptureUtils$NetworkHeaderExtractor;)Lio/sentry/util/network/ReplayNetworkRequestOrResponse;
7500
+
public static fun createResponse (Ljava/lang/Object;Ljava/lang/Long;ZLio/sentry/util/network/NetworkDetailCaptureUtils$NetworkBodyExtractor;Ljava/util/List;Lio/sentry/util/network/NetworkDetailCaptureUtils$NetworkHeaderExtractor;)Lio/sentry/util/network/ReplayNetworkRequestOrResponse;
7501
+
public static fun initializeForUrl (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;)Lio/sentry/util/network/NetworkRequestData;
7502
7502
}
7503
7503
7504
7504
public abstract interface class io/sentry/util/network/NetworkDetailCaptureUtils$NetworkBodyExtractor {
0 commit comments