diff --git a/ghost/core/core/server/services/link-tracking/LinkClickRepository.js b/ghost/core/core/server/services/link-tracking/LinkClickRepository.js index 67e03a4bcf..ca4e68ad4e 100644 --- a/ghost/core/core/server/services/link-tracking/LinkClickRepository.js +++ b/ghost/core/core/server/services/link-tracking/LinkClickRepository.js @@ -59,11 +59,19 @@ module.exports = class LinkClickRepository { async save(linkClick) { let member; - if (config && config.get('linkClickTrackingCacheMemberUuid')) { - member = await this.memoizedFindOne(linkClick.member_uuid); - } else { - member = await this.#Member.findOne({uuid: linkClick.member_uuid}); - } + sentry.startSpan({name: 'Member.findOne'}, async () => { + try { + console.log(`finding member`); + if (config && config.get('linkClickTrackingCacheMemberUuid')) { + member = await this.memoizedFindOne(linkClick.member_uuid); + } else { + member = await this.#Member.findOne({uuid: linkClick.member_uuid}); + } + } catch (error) { + sentry.captureException(error); + throw error; + } + }); if (!member) { if (config.get('bulkEmail:captureLinkClickBadMemberUuid')) { diff --git a/ghost/core/core/shared/sentry.js b/ghost/core/core/shared/sentry.js index ee5e29682b..483c053c74 100644 --- a/ghost/core/core/shared/sentry.js +++ b/ghost/core/core/shared/sentry.js @@ -151,6 +151,7 @@ if (sentryConfig && !sentryConfig.disabled) { tracingHandler: Sentry.Handlers.tracingHandler(), captureException: Sentry.captureException, captureMessage: Sentry.captureMessage, + startSpan: Sentry.startSpan, beforeSend: beforeSend, beforeSendTransaction: beforeSendTransaction, initQueryTracing: (knex) => {