add opt in docker logs
This commit is contained in:
1 parent
431cada08e
commit
c1af8995e4
5 files changed
+29
-1
No files matched your search
@@ -77,6 +77,7 @@ export const getMonitorDefaults = (
|
|||||||
...base,
|
...base,
|
||||||
type: "docker",
|
type: "docker",
|
||||||
url: data?.url || "",
|
url: data?.url || "",
|
||||||
|
dockerLogsEnabled: data?.dockerLogsEnabled ?? false,
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case "game":
|
case "game":
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ const CreateMonitorPage = () => {
|
|||||||
const firstSegment = pathSegments[0];
|
const firstSegment = pathSegments[0];
|
||||||
if (firstSegment === "pagespeed") return "pagespeed";
|
if (firstSegment === "pagespeed") return "pagespeed";
|
||||||
if (firstSegment === "infrastructure") return "hardware";
|
if (firstSegment === "infrastructure") return "hardware";
|
||||||
|
if (firstSegment === "docker") return "docker";
|
||||||
return "uptime";
|
return "uptime";
|
||||||
}, [location.pathname]);
|
}, [location.pathname]);
|
||||||
|
|
||||||
@@ -264,7 +265,9 @@ const CreateMonitorPage = () => {
|
|||||||
? "pagespeed"
|
? "pagespeed"
|
||||||
: pageType === "hardware"
|
: pageType === "hardware"
|
||||||
? "hardware"
|
? "hardware"
|
||||||
: "http";
|
: pageType === "docker"
|
||||||
|
? "docker"
|
||||||
|
: "http";
|
||||||
|
|
||||||
const { data: existingMonitor, refetch: refetchMonitor } = useGet<Monitor>(
|
const { data: existingMonitor, refetch: refetchMonitor } = useGet<Monitor>(
|
||||||
isEditMode ? `/monitors/${monitorId}` : null
|
isEditMode ? `/monitors/${monitorId}` : null
|
||||||
@@ -823,6 +826,19 @@ const CreateMonitorPage = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{showStep(1) && watchedType === "docker" && (
|
||||||
|
<ConfigBox
|
||||||
|
title={t("pages.createMonitor.form.dockerLogs.title")}
|
||||||
|
subtitle={t("pages.createMonitor.form.dockerLogs.description")}
|
||||||
|
rightContent={
|
||||||
|
<FormSwitchField
|
||||||
|
name="dockerLogsEnabled"
|
||||||
|
label={t("pages.createMonitor.form.dockerLogs.option.enabled.label")}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{showStep(2) &&
|
{showStep(2) &&
|
||||||
(watchedType === "http" ||
|
(watchedType === "http" ||
|
||||||
watchedType === "grpc" ||
|
watchedType === "grpc" ||
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ export interface Monitor {
|
|||||||
geoCheckEnabled?: boolean;
|
geoCheckEnabled?: boolean;
|
||||||
geoCheckLocations?: GeoContinent[];
|
geoCheckLocations?: GeoContinent[];
|
||||||
geoCheckInterval?: number;
|
geoCheckInterval?: number;
|
||||||
|
dockerLogsEnabled?: boolean;
|
||||||
dnsServer?: string;
|
dnsServer?: string;
|
||||||
dnsRecordType?: DnsRecordType;
|
dnsRecordType?: DnsRecordType;
|
||||||
recentChecks: CheckSnapshot[];
|
recentChecks: CheckSnapshot[];
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ const portSchema = baseSchema.extend({
|
|||||||
const dockerSchema = baseSchema.extend({
|
const dockerSchema = baseSchema.extend({
|
||||||
type: z.literal("docker"),
|
type: z.literal("docker"),
|
||||||
url: z.string().min(1, "Container ID is required"),
|
url: z.string().min(1, "Container ID is required"),
|
||||||
|
dockerLogsEnabled: z.boolean().register(monitorStepRegistry, { step: 1 }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Game server monitor schema
|
// Game server monitor schema
|
||||||
|
|||||||
@@ -814,6 +814,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"dockerLogs": {
|
||||||
|
"title": "Container logs",
|
||||||
|
"description": "Collect the most recent log lines from every container on this host on each check. Logs are kept for 7 days. Leave this off for hosts with chatty containers to save database space.",
|
||||||
|
"option": {
|
||||||
|
"enabled": {
|
||||||
|
"label": "Collect container logs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"stats": {
|
"stats": {
|
||||||
"title": "Monitor history",
|
"title": "Monitor history",
|
||||||
"description": "Clear all monitoring history and statistics for your team. This action is irreversible.",
|
"description": "Clear all monitoring history and statistics for your team. This action is irreversible.",
|
||||||
|
|||||||
Reference in new issue
Block a user