Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Add contexts to sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
anduong96 committed Feb 3, 2024
1 parent 6a64f74 commit 573116c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/scheduler/defined.jobs/flight.sync.job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ export class SyncActiveFlightsJob extends Job {
);

if (error) {
Sentry.captureException(error);
Sentry.captureException(error, {
contexts: {
params: {
flight,
flightStatsID,
},
},
});
}

return;
Expand Down
18 changes: 16 additions & 2 deletions src/services/alerts/alert.engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,29 @@ export async function handleFlightChangesForAlert(

const [createdTimeline, sentAlerts] = await Promise.allSettled([
createFlightChangeTimeline(current, difference).catch(error => {
Sentry.captureException(error);
Sentry.captureException(error, {
contexts: {
params: {
current,
difference,
},
},
});
Logger.error('Failed to create flight timeline', error);
}),
difference.length > 0
? sendFlightAlert(
flightID,
getFlightAlertPayload(current, difference),
).catch(error => {
Sentry.captureException(error);
Sentry.captureException(error, {
contexts: {
params: {
current,
difference,
},
},
});
Logger.error('Failed to send flight alert', error);
})
: null,
Expand Down

0 comments on commit 573116c

Please sign in to comment.