Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
// Props: https://github.com/getsentry/sentry-javascript/issues/9335#issuecomment-1779057528
import { captureCheckIn, flush } from "@sentry/nextjs";
export function runSentryCron(monitorSlug: string) {
// π‘ Notify Sentry your job is running:
const checkInId = captureCheckIn({
monitorSlug,
status: "in_progress",
});
return {
cronCompleted: async () => {
// π’ Notify Sentry your job has completed successfully:
captureCheckIn({
checkInId,
monitorSlug,
status: "ok",
});
return flush();
},
cronFailed: async () => {
// π΄ Notify Sentry your job has failed:
captureCheckIn({
checkInId,
monitorSlug,
status: "error",
});
return flush();
},
};
}