Add logging when manually changing the hc status

This commit is contained in:
Owen
2026-04-26 17:28:57 -07:00
parent 06af53c4d6
commit ca2370e31d
21 changed files with 170 additions and 45 deletions

View File

@@ -22,6 +22,7 @@ import logger from "@server/logger";
import { fromError } from "zod-validation-error";
import { OpenAPITags, registry } from "@server/openApi";
import { addStandaloneHealthCheck } from "@server/routers/newt/targets";
import { fireHealthCheckUnhealthyAlert } from "#private/lib/alerts";
const paramsSchema = z.strictObject({
orgId: z.string().nonempty()
@@ -146,6 +147,15 @@ export async function createHealthCheck(
})
.returning();
await fireHealthCheckUnhealthyAlert(
record.orgId,
record.targetHealthCheckId,
record.name || "",
undefined,
undefined,
false // dont send the alert because we just want to create the alert, not notify users yet
);
// Push health check to newt if the site is a newt site
if (siteId) {
const [site] = await db