feat(replay): [Data Collection 16] Inherit network collection policy#5832
Draft
adinauer wants to merge 1 commit into
Draft
Conversation
Let nullable Session Replay network options inherit matching Data Collection settings while preserving historical Replay defaults when Data Collection is absent. Keep explicit Replay options authoritative and apply the effective policies to OkHttp network details. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
This was referenced Jul 24, 2026
adinauer
commented
Jul 24, 2026
| optionsPayload.put("networkRequestHeaders", replayOptions.getNetworkRequestHeaders()); | ||
| optionsPayload.put("networkResponseHeaders", replayOptions.getNetworkResponseHeaders()); | ||
| optionsPayload.put("networkCaptureBodies", replayOptions.isNetworkCaptureBodies()); | ||
| final @NotNull KeyValueCollectionBehavior requestHeaders = |
Member
Author
There was a problem hiding this comment.
This class needs some discussion, can we somehow send whether OFF / DENY or ALLOW was used?
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
This was referenced Jul 24, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Stack (Data Collection)
📜 Description
Make Session Replay network body and header options nullable overrides that can inherit the global Data Collection policy.
Explicit Replay options remain authoritative. When a Replay option is unset and Data Collection is configured, request and response headers inherit their matching
httpHeadersbehavior, while bodies inherit the matching outgoing-request and incoming-response body settings. If Data Collection is absent, Replay preserves its historical defaults: body capture enabled and theContent-Type,Content-Length, andAcceptheader allow-list.Add
KeyValueCollectionBehaviorReplay APIs for header policies while retaining deprecated list-based APIs for compatibility. Apply effective policies to OkHttp Replay network details and preserve the existing RRWeb options payload shape.Android manifest options now preserve nullable inheritance when metadata is absent and continue to take precedence when explicitly configured.
💡 Motivation and Context
Session Replay previously maintained independent network defaults, so opting into Data Collection did not consistently control network content included in recordings. Nullable Replay overrides provide an explicit precedence model without breaking the existing primitive and list-based Java APIs.
The Replay URL allow and deny lists remain independent eligibility controls. Data Collection only determines which content an eligible request may serialize.
Refs #5666
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry:apiCheck :sentry:test --tests='io.sentry.SentryReplayOptionsTest' --tests='io.sentry.util.network.NetworkDetailCaptureUtilsTest' --tests='io.sentry.rrweb.RRWebOptionsEventSerializationTest' :sentry-okhttp:test --tests='io.sentry.okhttp.SentryOkHttpInterceptorTest' :sentry-android-core:testDebugUnitTest --tests='io.sentry.android.core.ManifestMetadataReaderTest'git diff --check📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Coordinate richer RRWeb options metadata if Sentry needs to distinguish directional body policies and non-allow-list header behaviors.
#skip-changelog