Skip to content
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

fix: filter SES from Sentry stack trace frames #8584

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/util/sentry/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,25 @@ function removeDeviceName(report) {
report.contexts.device.name = null;
}

/**
* Removes SES from the Sentry error event stack trace.
* By default, SES is shown as the top level frame, which can obscure errors.
* We filter it out by identifying the SES stack trace frame simply by 'filename',
* since the 'context_line' is rather verbose.
* @param {*} report - the error event
*/
function removeSES(report) {
const stacktraceFrames = report.exception.values[0].stacktrace.frames;
const filteredFrames = stacktraceFrames.filter(
(frame) => frame.filename !== 'app:///ses.cjs',
);
report.exception.values[0].stacktrace.frames = filteredFrames;
}

function rewriteReport(report) {
try {
// filter out SES from error stack trace
removeSES(report);
// simplify certain complex error messages (e.g. Ethjs)
simplifyErrorMessages(report);
// remove urls from error message
Expand Down
Loading