diff --git a/src/sentry_webhook/index.ts b/src/sentry_webhook/index.ts index bfe31fd44..4d0aa7608 100644 --- a/src/sentry_webhook/index.ts +++ b/src/sentry_webhook/index.ts @@ -32,13 +32,16 @@ exports.postSentryEventToSalesforce = (req: express.Request, res: express.Respon if (!sentryEvent) { return res.status(400).send('Missing Sentry event'); } + const eventId = sentryEvent.event_id?.replace(/\n|\r/g, ''); if (!shouldPostEventToSalesforce(sentryEvent)) { + console.log('Not posting event:', eventId); return res.status(200).send(); } // Use the request message if SentryEvent.message is unpopulated. sentryEvent.message = sentryEvent.message || req.body.message; postSentryEventToSalesforce(sentryEvent, req.body.project) .then(() => { + console.log('Successfully posted event:', eventId); res.status(200).send(); }) .catch((e) => { diff --git a/src/sentry_webhook/post_sentry_event_to_salesforce.ts b/src/sentry_webhook/post_sentry_event_to_salesforce.ts index d7d325cd4..61deaf17b 100644 --- a/src/sentry_webhook/post_sentry_event_to_salesforce.ts +++ b/src/sentry_webhook/post_sentry_event_to_salesforce.ts @@ -108,6 +108,7 @@ export function postSentryEventToSalesforce(event: SentryEvent, project: string) }, (res) => { if (res.statusCode === 200) { + console.debug('Salesforce `is-processed`:', res.headers['is-processed']); resolve(); } else { reject(new Error(`Failed to post form data, response status: ${res.statusCode}`));