From 35edb30e1829112b1a419e248ad35c3867e4820c Mon Sep 17 00:00:00 2001 From: Steve Larson <9larsons@gmail.com> Date: Mon, 16 Dec 2024 08:38:16 -0600 Subject: [PATCH] f --- .../server/services/link-tracking/LinkClickRepository.js | 6 +++--- ghost/core/core/shared/sentry.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ghost/core/core/server/services/link-tracking/LinkClickRepository.js b/ghost/core/core/server/services/link-tracking/LinkClickRepository.js index ca4e68ad4e..a80a4b4064 100644 --- a/ghost/core/core/server/services/link-tracking/LinkClickRepository.js +++ b/ghost/core/core/server/services/link-tracking/LinkClickRepository.js @@ -59,10 +59,10 @@ module.exports = class LinkClickRepository { async save(linkClick) { let member; - sentry.startSpan({name: 'Member.findOne'}, async () => { + const usingCache = config && config.get('linkClickTrackingCacheMemberUuid'); + await sentry.startSpan({name: `Member.findOne > ${usingCache ? 'cache' : 'db'}`}, async () => { try { - console.log(`finding member`); - if (config && config.get('linkClickTrackingCacheMemberUuid')) { + if (usingCache) { member = await this.memoizedFindOne(linkClick.member_uuid); } else { member = await this.#Member.findOne({uuid: linkClick.member_uuid}); diff --git a/ghost/core/core/shared/sentry.js b/ghost/core/core/shared/sentry.js index 483c053c74..3c52224008 100644 --- a/ghost/core/core/shared/sentry.js +++ b/ghost/core/core/shared/sentry.js @@ -76,7 +76,8 @@ const ALLOWED_HTTP_TRANSACTIONS = [ '/members/api', // any Members API call '/:slug', // any frontend post/page '/author', // any frontend author page - '/tag' // any frontend tag page + '/tag', // any frontend tag page + '/r' // redirect ].map((path) => { // Sentry names HTTP transactions like: " " i.e. "GET /ghost/api/content/settings" // Match any of the paths above with any HTTP method, and also the homepage "GET /" @@ -88,10 +89,10 @@ const ALLOWED_HTTP_TRANSACTIONS = [ * @returns {import('@sentry/node').Event | null} */ const beforeSendTransaction = function (event) { + console.log(`event.transaction`, event.transaction); // Drop transactions that are not in the allowed list for (const transaction of ALLOWED_HTTP_TRANSACTIONS) { const match = event.transaction.match(transaction); - if (match?.groups?.path) { return event; }