0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added sentry logging to member lookup for link clicks

no ref
This commit is contained in:
Steve Larson 2024-12-10 13:56:08 -06:00
parent 0f9449137f
commit a60756b321
2 changed files with 14 additions and 5 deletions

View file

@ -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')) {

View file

@ -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) => {