File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -199,17 +199,18 @@ export class ReplayContainer implements ReplayContainerInterface {
199199 ...( this . recordingMode === 'error' && { checkoutEveryNms : ERROR_CHECKOUT_TIME } ) ,
200200 emit : this . _handleRecordingEmit ,
201201 onMutation : ( mutations : unknown [ ] ) => {
202- const count = mutations . length ;
203-
204- if ( count > 500 ) {
205- const breadcrumb = createBreadcrumb ( {
206- category : 'replay.mutations' ,
207- message : `A mutation with ${ count } changes was recorded, which may indicate slow performance.` ,
208- data : {
209- mutationsCount : count ,
210- } ,
211- } ) ;
212- this . _createCustomBreadcrumb ( breadcrumb ) ;
202+ if ( this . _options . _experiments . captureMutationSize ) {
203+ const count = mutations . length ;
204+
205+ if ( count > 500 ) {
206+ const breadcrumb = createBreadcrumb ( {
207+ category : 'replay.mutations' ,
208+ data : {
209+ length : count ,
210+ } ,
211+ } ) ;
212+ this . _createCustomBreadcrumb ( breadcrumb ) ;
213+ }
213214 }
214215 // `true` means we use the regular mutation handling by rrweb
215216 return true ;
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ export interface ReplayPluginOptions extends SessionOptions {
105105 _experiments : Partial < {
106106 captureExceptions : boolean ;
107107 traceInternals : boolean ;
108+ captureMutationSize : boolean ;
108109 } > ;
109110}
110111
You can’t perform that action at this time.
0 commit comments