Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
πͺ΅ improve log (#771)
Thibault Le Ouay8e5c8aab762e
diff --git a/apps/server/src/checker/alerting.ts b/apps/server/src/checker/alerting.tsindex c3be56603..d7a106f93 100644--- a/apps/server/src/checker/alerting.ts+++ b/apps/server/src/checker/alerting.ts@@ -79,7 +79,7 @@ export const upsertMonitorStatus = async ({status: MonitorStatus;region: MonitorFlyRegion;}) => {- await db+ const newData = await db.insert(schema.monitorStatusTable).values({ status, region, monitorId: Number(monitorId) }).onConflictDoUpdate({@@ -88,5 +88,8 @@ export const upsertMonitorStatus = async ({schema.monitorStatusTable.region,],set: { status, updatedAt: new Date() },- });+ })+ .returning();+ console.log(`π upsertMonitorStatus for ${monitorId} in region ${region}`);+ console.log(`π€ upsert monitor ${JSON.stringify(newData)}`);};diff --git a/apps/server/src/checker/index.ts b/apps/server/src/checker/index.tsindex a199a8439..a4cd177ce 100644--- a/apps/server/src/checker/index.ts+++ b/apps/server/src/checker/index.ts@@ -98,6 +98,9 @@ checkerRoute.post("/updateStatus", async (c) => {const numberOfRegions = monitor.regions.length;+ console.log(+ `π€ MonitorID ${monitorId} incident current affected ${nbAffectedRegion} total region ${numberOfRegions}`,+ );// If the number of affected regions is greater than half of the total region, we trigger the alerting// 4 of 6 monitor need to fail to trigger an alertingif (nbAffectedRegion > numberOfRegions / 2) {@@ -187,6 +190,9 @@ checkerRoute.post("/updateStatus", async (c) => {const numberOfRegions = monitor.regions.length;+ console.log(+ `π€ MonitorId ${monitorId} recovering incident current ${nbAffectedRegion} total region ${numberOfRegions}`,+ );// // If the number of affected regions is greater than half of the total region, we trigger the alerting// // 4 of 6 monitor need to fail to trigger an alertingif (nbAffectedRegion > numberOfRegions / 2) {@@ -202,6 +208,7 @@ checkerRoute.post("/updateStatus", async (c) => {).get();if (incident) {+ console.log(`π€ recovering incident ${incident.id}`);await db.update(incidentTable).set({