feat: show unchecked monitors and tell about regions without checkers
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m17s
ci / test (pull_request) Successful in 12m7s
ci / build (pull_request) Successful in 19m34s
ci / image (pull_request) Successful in 3m15s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m17s
ci / test (pull_request) Successful in 12m7s
ci / build (pull_request) Successful in 19m34s
ci / image (pull_request) Successful in 3m15s
A region whose checkers had all gone left its monitors looking up: the console and status pages took the last result, however old, and nobody was told. - A region's last result counts only while it is younger than the evaluator's staleness (3 intervals, at least 2 minutes); older ones show as "no data since …" in the console and leave status page components unknown instead of operational. - A monitor no region has reported for recently is marked "not being checked", counted on the dashboard with an explanation, and noted on its page. - A region watch on every API replica emails the platform's admins (platform regions) or the organization's owners (own regions) once a region with checkers and enabled monitors has had no live checker for UPTIME_REGION_ALERT_AFTER (default 5m), and again when one is back. The dashboard names such regions at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
f3d0a4c844
commit
dc2e21f964
18 files changed
+3272
-2652
No files matched your search
@@ -28,6 +28,9 @@ type MonitorRow struct {
|
||||
Latency string
|
||||
Uptime string
|
||||
Bars []Bar
|
||||
// Unchecked is set when no region has reported recently: nobody is
|
||||
// checking the monitor.
|
||||
Unchecked bool
|
||||
}
|
||||
|
||||
// GroupNode is a monitor group with its monitors and subgroups.
|
||||
@@ -64,6 +67,15 @@ type DashboardView struct {
|
||||
Counts map[Status]int
|
||||
Range string
|
||||
Ranges []RangeOption
|
||||
// Unchecked counts the monitors no region has reported for recently.
|
||||
Unchecked int
|
||||
// DeadRegions are regions of the monitors without a live checker.
|
||||
DeadRegions []DeadRegion
|
||||
}
|
||||
|
||||
// DeadRegion is a region without a live checker since Since.
|
||||
type DeadRegion struct {
|
||||
Name, Since string
|
||||
}
|
||||
|
||||
// RangeOption is an entry of the range switcher. Disabled ranges are not
|
||||
@@ -151,7 +163,7 @@ templ Dashboard(p Page, me Me, v DashboardView) {
|
||||
<h1 class="text-lg font-semibold">{ i18n.T(ctx, "console.monitors.title") }</h1>
|
||||
<div class="flex flex-wrap items-center gap-x-5 gap-y-3 font-mono text-xs text-muted">
|
||||
@rangeSwitch(v.Ranges)
|
||||
for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusMaintenance, StatusPaused} {
|
||||
for _, s := range []Status{StatusUp, StatusDegraded, StatusDown, StatusUnknown, StatusMaintenance, StatusPaused} {
|
||||
if v.Counts[s] > 0 {
|
||||
<span class="flex items-center gap-1.5">
|
||||
@statusDot(s)
|
||||
@@ -164,6 +176,16 @@ templ Dashboard(p Page, me Me, v DashboardView) {
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
if v.Unchecked > 0 || len(v.DeadRegions) > 0 {
|
||||
<div class="mb-6 border-l-2 border-unknown pl-3 text-sm" role="status">
|
||||
for _, r := range v.DeadRegions {
|
||||
<p>{ i18n.T(ctx, "monitors.dead_region", "Region", r.Name, "Since", r.Since) }</p>
|
||||
}
|
||||
if v.Unchecked > 0 {
|
||||
<p>{ i18n.T(ctx, "monitors.unchecked_banner", "Count", v.Unchecked) }</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
if !v.Empty {
|
||||
<form method="get" action="/" class="mb-4 flex max-w-md gap-2">
|
||||
if v.Range != "" {
|
||||
@@ -229,7 +251,11 @@ templ monitorList(ms []MonitorRow) {
|
||||
</span>
|
||||
</span>
|
||||
<span class="col-span-2 md:col-span-1">@bars(m.Bars, 18)</span>
|
||||
<span class="hidden text-right font-mono text-xs text-muted md:block">{ m.Latency }</span>
|
||||
if m.Unchecked {
|
||||
<span class="hidden text-right font-mono text-xs text-unknown md:block">{ i18n.T(ctx, "monitors.unchecked") }</span>
|
||||
} else {
|
||||
<span class="hidden text-right font-mono text-xs text-muted md:block">{ m.Latency }</span>
|
||||
}
|
||||
<span class="col-start-2 row-start-1 text-right font-mono text-sm md:col-auto md:row-auto">{ m.Uptime }</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -350,6 +376,9 @@ templ MonitorDetail(p Page, me Me, v MonitorDetailView) {
|
||||
<a href={ templ.SafeURL("/monitors/" + v.Row.ID + "/edit") } class="border border-ink px-3 py-1.5 text-sm hover:bg-ink hover:text-paper">{ i18n.T(ctx, "sso.action.edit") }</a>
|
||||
}
|
||||
</div>
|
||||
if v.Row.Unchecked {
|
||||
<p class="mb-8 border-l-2 border-unknown pl-3 text-sm" role="status">{ i18n.T(ctx, "monitors.unchecked_banner", "Count", 1) }</p>
|
||||
}
|
||||
<section class="mb-10">
|
||||
<div class="mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2">
|
||||
<h2 class="text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "monitors.history", "Range", v.Range) }</h2>
|
||||
|
||||
+2750
-2635
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user