Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
📸 screenshot fly improvment (#757)
Thibault Le Ouay5897325a2076
diff --git a/apps/screenshot-service/fly.toml b/apps/screenshot-service/fly.tomlindex 1a7691da8..1dd4d0f3d 100644--- a/apps/screenshot-service/fly.toml+++ b/apps/screenshot-service/fly.toml@@ -35,4 +35,4 @@ primary_region = 'ams'[[vm]]cpu_kind = 'shared'cpus = 2- memory_mb = 1024+ memory_mb = 2048diff --git a/apps/screenshot-service/src/index.ts b/apps/screenshot-service/src/index.tsindex 93eba9240..74bf53baf 100644--- a/apps/screenshot-service/src/index.ts+++ b/apps/screenshot-service/src/index.ts@@ -47,34 +47,50 @@ app.post(headless: true, // set this to true});- const page = await browser.newPage();- await page.goto(data.url, { waitUntil: "networkidle" });- const img = await page.screenshot();- const id = `${data.incidentId}-${Date.now()}.png`;- const url = `https://screenshot.openstat.us/${id}`;-- await S3.send(- new PutObjectCommand({- Body: img,- Bucket: "incident-screenshot",- Key: id,- ContentType: "image/png",- }),- );-- if (data.kind === "incident") {- await db- .update(incidentTable)- .set({ incidentScreenshotUrl: url })- .where(eq(incidentTable.id, data.incidentId))- .run();- }- if (data.kind === "recovery") {- await db- .update(incidentTable)- .set({ recoveryScreenshotUrl: url })- .where(eq(incidentTable.id, data.incidentId))- .run();+ try {+ const page = await browser.newPage();+ await page.goto(data.url, { waitUntil: "load" });+ const img = await page.screenshot({ fullPage: true });+ const id = `${data.incidentId}-${Date.now()}.png`;+ const url = `https://screenshot.openstat.us/${id}`;++ await S3.send(+ new PutObjectCommand({+ Body: img,+ Bucket: "incident-screenshot",+ Key: id,+ ContentType: "image/png",+ }),+ );++ if (data.kind === "incident") {+ await db+ .update(incidentTable)+ .set({ incidentScreenshotUrl: url })+ .where(eq(incidentTable.id, data.incidentId))+ .run();+ }+ if (data.kind === "recovery") {+ await db+ .update(incidentTable)+ .set({ recoveryScreenshotUrl: url })+ .where(eq(incidentTable.id, data.incidentId))+ .run();+ }+ } catch (e) {+ console.log("could not take screenshot timeout");+ if (data.kind === "incident") {+ await db+ .update(incidentTable)+ .set({+ incidentScreenshotUrl:+ "https://screenshot.openstat.us/err-connection-timed-out.jpg",+ })+ .where(eq(incidentTable.id, data.incidentId))+ .run();+ }+ //+ console.log(e);}return c.text("Screenshot saved");@@ -86,6 +102,7 @@ app.get("/", async (c) => {headless: true, // set this to true});const page = await browser.newPage();+await page.goto("https://www.openstatus.dev", { waitUntil: "networkidle" });const img = await page.screenshot();const id = `test-$${Date.now()}.png`;diff --git a/packages/emails/emails/welcome.tsx b/packages/emails/emails/welcome.tsxindex bc9d78e7a..2cdaf580b 100644--- a/packages/emails/emails/welcome.tsx+++ b/packages/emails/emails/welcome.tsx@@ -31,8 +31,9 @@ const WelcomeEmail = () => {</a>{" "}and{" "}<a href="https://docs.openstatus.dev/packages/react">React Widget</a>- <br />- Build your own status page with our <a href="">API</a> and- host it where you want. Here's our{" "}+ <br />- Build your own status page with our{" "}+ <a href="https://docs.openstatus.dev/api-reference">API</a> and host+ it where you want. Here's our{" "}<a href="https://github.com/openstatusHQ/astro-status-page">Astro template</a>{" "}