Skip to content

Commit 894a135

Browse files
committed
Refactor(grafana): overhaul dashboards and logging
- Improve migration error handling when adding clear_cache column - Pass projectId to Grafana dashboard creation and load project domains - Overhaul Grafana dashboards to system overview with metrics - Highlight CRITICAL and ERROR logs in deployment logs
1 parent 5c49ed9 commit 894a135

5 files changed

Lines changed: 810 additions & 75 deletions

File tree

apps/api/src/db/migrate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const addClearCacheColumn = async (db: ReturnType<typeof getDrizzle>) => {
3838
db.run(sql`ALTER TABLE deployments ADD COLUMN clear_cache integer NOT NULL DEFAULT 0`);
3939
console.log("[Migrate] Added clear_cache column to deployments table");
4040
} catch (err) {
41-
if (err instanceof Error && err.message.includes("duplicate column name")) return;
41+
const cause = err instanceof Error && "cause" in err ? err.cause : err;
42+
if (cause instanceof Error && cause.message.includes("duplicate column name")) return;
4243
console.error("[Migrate] Failed to add clear_cache column:", err);
4344
throw err;
4445
}

apps/api/src/orchestrator/pipeline.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ export class PipelineOrchestrator {
554554
.slice(0, 63);
555555
const containerRegex = `${dashSlug}-.*`;
556556
ensureProjectDashboard(
557+
deployment.projectId!,
557558
projectName,
558559
containerRegex,
559560
).catch((e) =>

0 commit comments

Comments
 (0)