Skip to content

Open-source status page, incident response and uptime monitoring

🚀 improve fly (#449)

Thibault Le Ouayda3787342783
diff --git a/apps/server/fly.toml b/apps/server/fly.toml
index fe3151fc8..2b43881e9 100644
--- a/apps/server/fly.toml
+++ b/apps/server/fly.toml
@@ -15,30 +15,30 @@ primary_region = "ams"
force_https = true
auto_stop_machines = true
auto_start_machines = true
- min_machines_running = 0
+ min_machines_running = 6
processes = ["app"]
[deploy]
- strategy = "rolling"
+ strategy = "canary"
[[http_service.checks]]
grace_period = "10s"
- interval = "60s"
+ interval = "15s"
method = "GET"
timeout = "5s"
path = "/ping"
-[checks]
- [checks.name_of_your_http_check]
- port = 3000
- type = "http"
- interval = "15s"
- timeout = "10s"
- grace_period = "30s"
- method = "get"
- path = "/ping"
+# [checks]
+# [checks.name_of_your_http_check]
+# port = 3000
+# type = "http"
+# interval = "15s"
+# timeout = "10s"
+# grace_period = "30s"
+# method = "get"
+# path = "/ping"
# [[services.http_checks]]
# interval = 10000
diff --git a/apps/server/src/index.ts b/apps/server/src/index.ts
index 6da53a2a1..625778d53 100644
--- a/apps/server/src/index.ts
+++ b/apps/server/src/index.ts
@@ -1,5 +1,6 @@
import { sentry } from "@hono/sentry";
import { Hono } from "hono";
+import { logger } from "hono/logger";
import { checkerRoute } from "./checker";
import { env } from "./env";
@@ -23,6 +24,7 @@ app.route("/public", publicRoute);
/**
* Ping Pong
*/
+app.use("/ping", logger());
app.get("/ping", (c) => c.json({ ping: "pong", region: env.FLY_REGION }, 200));
/**
diff --git a/apps/server/src/public/index.ts b/apps/server/src/public/index.ts
index 62297d5c7..21e485a3e 100644
--- a/apps/server/src/public/index.ts
+++ b/apps/server/src/public/index.ts
@@ -1,7 +1,9 @@
import { Hono } from "hono";
+import { logger } from "hono/logger";
import { status } from "./status";
export const publicRoute = new Hono();
+publicRoute.use("*", logger());
publicRoute.route("/status", status);
diff --git a/apps/server/src/v1/index.ts b/apps/server/src/v1/index.ts
index 800426324..c2aede596 100644
--- a/apps/server/src/v1/index.ts
+++ b/apps/server/src/v1/index.ts
@@ -1,4 +1,5 @@
import { OpenAPIHono } from "@hono/zod-openapi";
+import { logger } from "hono/logger";
import type { Plan } from "@openstatus/plans";
@@ -26,7 +27,7 @@ api.doc("/openapi", {
* Authentification Middleware
*/
api.use("/*", middleware);
-
+api.use("/*", logger());
api.route("/monitor", monitorApi);
api.route("/incident_update", incidenUpdatetApi);