-
Notifications
You must be signed in to change notification settings - Fork 475
Filter sessions without an error setting #5123
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
Conversation
|
Your Render PR Server URL is https://frontend-pr-5123.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-ch4jk03k9u561ni805hg. |
Vadman97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we update ProcessPayload to determine whether a session should be un-excluded on events pushed based on the FilterSessionsWithoutError setting? that way, we won't show the live session in the feed until there is an error
highlight/backend/public-graph/graph/resolver.go
Lines 2967 to 3000 in 34a5686
| doUpdate := sessionObj.PayloadUpdatedAt == nil || | |
| now.Sub(*sessionObj.PayloadUpdatedAt) > 15*time.Second || | |
| beaconTime != nil || | |
| hasSessionUnloaded != sessionObj.HasUnloaded || | |
| (sessionObj.Processed != nil && *sessionObj.Processed) || | |
| (sessionObj.ObjectStorageEnabled != nil && *sessionObj.ObjectStorageEnabled) || | |
| (sessionObj.Chunked != nil && *sessionObj.Chunked) || | |
| (sessionObj.Excluded != nil && *sessionObj.Excluded) || | |
| (sessionHasErrors && (sessionObj.HasErrors == nil || !*sessionObj.HasErrors)) | |
| if doUpdate { | |
| fieldsToUpdate := model.Session{ | |
| PayloadUpdatedAt: &now, BeaconTime: beaconTime, HasUnloaded: hasSessionUnloaded, Processed: &model.F, ObjectStorageEnabled: &model.F, DirectDownloadEnabled: false, Chunked: &model.F, Excluded: &model.F, | |
| } | |
| // We only want to update the `HasErrors` field if the session has errors. | |
| if sessionHasErrors { | |
| fieldsToUpdate.HasErrors = &model.T | |
| if err := r.DB.Model(&model.Session{Model: model.Model{ID: sessionID}}). | |
| Select("PayloadUpdatedAt", "BeaconTime", "HasUnloaded", "Processed", "ObjectStorageEnabled", "Chunked", "DirectDownloadEnabled", "Excluded", "HasErrors"). | |
| Updates(&fieldsToUpdate).Error; err != nil { | |
| log.WithContext(ctx).Error(e.Wrap(err, "error updating session payload time and beacon time with errors")) | |
| return err | |
| } | |
| } else { | |
| if err := r.DB.Model(&model.Session{Model: model.Model{ID: sessionID}}). | |
| Select("PayloadUpdatedAt", "BeaconTime", "HasUnloaded", "Processed", "ObjectStorageEnabled", "Chunked", "DirectDownloadEnabled", "Excluded"). | |
| Updates(&fieldsToUpdate).Error; err != nil { | |
| log.WithContext(ctx).Error(e.Wrap(err, "error updating session payload time and beacon time")) | |
| return err | |
| } | |
| } | |
| } |
34a5686 to
a340ef2
Compare
docs-content/general/6_product-features/1_session-replay/ignoring-sessions.md
Show resolved
Hide resolved
docs-content/general/6_product-features/2_error-monitoring/ignoring-errors.md
Show resolved
Hide resolved
Vadman97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall! 🚢
Summary
This PR adds the ability to filter sessions that do not have an error.
The frontend for this PR adds a new project filter setting that works similar to how we filter Chrome extension errors (see #4890 and #4921).
The backend for this PR introduces a new table,
project_filter_settingsfor storing various filter settings going forward (currently, they're just stuffed on theprojectmodel).The actual filtering works exactly how #5158 describes by simply checking to see if the session has an error.
How did you test this change?
Without setting checked, verified that all sessions are visible regardless if they have an error.
With setting checked
Are there any deployment considerations?