Repository navigation
feat: add masked session replay lifecycle - #17194
Open
graphaelli wants to merge 2 commits into
Open
graphaelli wants to merge 2 commits into
graphaelli wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Summary
Session replay already has SDK and proxy support. This adds session-replay opt-in while keeping recording off by default. The browser masks DOM text and input values, stops recording when authentication or replay permission disappears, and preserves the general RUM sampling decision when replay is toggled.
How it works
Enable replay explicitly through YAML:
Alternatively, set
RUM_ENABLED=trueandRUM_SESSION_REPLAY_ENABLED=trueusing the existing collector/authentication settings. YAML flags take precedence over environment settings./api/rum/v1/traces; replay records and ordinary browser logs share/api/rum/v1/logs. The authenticated proxy keeps collector credentials out of the browser.packages/api, leaving the legacy JavaScript module as wiring.Type of change
Testing
Reproduction:
rum.sessionId.RUM_CLIENT_LOGS=true. Confirm ordinary logs still ingest, replay-only requests are dropped, and mixed batches retain only ordinary records.Automated checks on rebased head
9289e3634:tsc --noEmitpassed inpackages/api,packages/data-provider, andclient.dev.E2E_BASE_URL=http://localhost:3098 npm run lighthousepassed: median LCP 3.47 s (4.5 s budget), CLS 0.018, and TBT 54 ms.Separate local integration validation:
Screenshots / recordings
5140d1e265134f3bcd9046f59b4a5a76-useful.mp4
Risk / compatibility
Checklist
.env.exampleandlibrechat.example.yaml