From 63c674828ae66d87221d4c07832b96ca242e3e55 Mon Sep 17 00:00:00 2001 From: Sag Date: Tue, 11 Jun 2024 12:17:21 +0200 Subject: [PATCH] Removed Sentry message on successful Lexical save (#20362) fixes https://linear.app/tryghost/issue/SLO-147 - removed Sentry message when the Lexical save is slow but successful - bumped Sentry message to error level when the Lexical is slow and fails --- ghost/admin/app/controllers/lexical-editor.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index a472228884..4f0c41e5bc 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -16,7 +16,6 @@ import {GENERIC_ERROR_MESSAGE} from '../services/notifications'; import {action, computed} from '@ember/object'; import {alias, mapBy} from '@ember/object/computed'; import {capitalizeFirstLetter} from '../helpers/capitalize-first-letter'; -import {captureMessage} from '@sentry/ember'; import {dropTask, enqueueTask, restartableTask, task, taskGroup, timeout} from 'ember-concurrency'; import {htmlSafe} from '@ember/template'; import {inject} from 'ghost-admin/decorators/inject'; @@ -793,22 +792,11 @@ export default class LexicalEditorController extends Controller { try { yield post.save(options); - - // log if a save is slow - if (this.config.sentry_dsn && (Date.now() - startTime > 2000)) { - captureMessage('Successful Lexical save took > 2s', (scope) => { - scope.setTag('save_time', Math.ceil((Date.now() - startTime) / 1000)); - scope.setTag('post_type', post.isPage ? 'page' : 'post'); - scope.setTag('save_revision', options.adapterOptions?.saveRevision); - scope.setTag('email_segment', options.adapterOptions?.emailSegment); - scope.setTag('convert_to_lexical', options.adapterOptions?.convertToLexical); - }); - } } catch (error) { this.post.set('emailOnly', previousEmailOnlyValue); if (this.config.sentry_dsn && (Date.now() - startTime > 2000)) { - captureMessage('Failed Lexical save took > 2s', (scope) => { + Sentry.captureException('Failed Lexical save took > 2s', (scope) => { scope.setTag('save_time', Math.ceil((Date.now() - startTime) / 1000)); scope.setTag('post_type', post.isPage ? 'page' : 'post'); scope.setTag('save_revision', options.adapterOptions?.saveRevision);