feat(status): second check region (enam) for the website + visible check location (#15)
All 456 of 456 latency samples in the live state come from LHR — a single run-length entry per monitor, no second value. One vantage point cannot tell "the service is down" from "the route from this one colo is down". Adds exactly one second-region monitor (website_enam, worker://enam) with checkProxyFallback: true, and makes the measured check location visible on the page instead of hiding it in a hover-only chart tooltip. checkProxyFallback is mandatory, not cosmetic: without it monitor.ts:397-400 records a failure of the PROBE as up:false / "Unknown check proxy error", so a probe outage would be published as a service outage. Co-authored-by: Test User <test@example.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>pull/216/head
parent
82562e7f99
commit
a21be253cb
|
|
@ -4,6 +4,7 @@ import { IconAlertCircle, IconAlertTriangle, IconCircleCheck } from '@tabler/ico
|
|||
import DetailChart from './DetailChart'
|
||||
import DetailBar from './DetailBar'
|
||||
import { getColor } from '@/util/color'
|
||||
import { codeToCountry } from '@/util/iata'
|
||||
import { maintenances } from '@/uptime.config'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
|
|
@ -64,6 +65,14 @@ export default function MonitorDetail({
|
|||
|
||||
const uptimePercent = (((totalTime - downTime) / totalTime) * 100).toPrecision(4)
|
||||
|
||||
// Where the most recent check actually ran. Until now this was only in the
|
||||
// latency-chart hover tooltip, i.e. invisible on touch devices — and with
|
||||
// more than one check region the reader has to be able to tell the rows
|
||||
// apart without a mouse. Read from the measurement itself, never from the
|
||||
// configured region, so a fallback run (monitor.ts:395-396, local re-check
|
||||
// after a probe failure) is reported as the location it really came from.
|
||||
const lastLoc = state.latency[monitor.id].slice(-1)[0]?.loc
|
||||
|
||||
// Conditionally render monitor name with or without hyperlink based on monitor.url presence
|
||||
const monitorNameElement = (
|
||||
<Text mt="sm" fw={700} style={{ display: 'inline-flex', alignItems: 'center' }}>
|
||||
|
|
@ -101,6 +110,12 @@ export default function MonitorDetail({
|
|||
</Text>
|
||||
</div>
|
||||
|
||||
{lastLoc && (
|
||||
<Text size="xs" c="dimmed" mt={2}>
|
||||
{t('Checked from', { location: codeToCountry(lastLoc) })}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
<DetailBar monitor={monitor} state={state} />
|
||||
{!monitor.hideLatencyChart && <DetailChart monitor={monitor} state={state} />}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -39,5 +39,6 @@
|
|||
"Forward": "Forward →",
|
||||
"30 days ago": "30 days ago",
|
||||
"window uptime": "{{percent}} % uptime",
|
||||
"Today": "Today"
|
||||
"Today": "Today",
|
||||
"Checked from": "Checked from {{location}}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,54 +61,52 @@ const workerConfig: WorkerConfig = {
|
|||
// Mini health is created later, add it here as an HTTP monitor.
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// PREPARED, DELIBERATELY NOT ENABLED: checks from more than one region.
|
||||
// SECOND CHECK REGION — exactly one, for the website only.
|
||||
//
|
||||
// Measured 2026-07-30 from the live state: 435 of 435 latency samples
|
||||
// (145 per monitor, the 12h window) carry loc "LHR" — London, not
|
||||
// Frankfurt as previously reported. Every monitor above omits
|
||||
// `checkProxy`, so each check runs in whatever colo the cron worker was
|
||||
// scheduled in. One vantage point cannot distinguish "the service is
|
||||
// down" from "the route from this one colo is down".
|
||||
// Why: measured 2026-07-31 from the live compacted state, 456 of 456
|
||||
// latency samples (152 per monitor, the 12h window) carry loc "LHR" —
|
||||
// a single run-length entry per monitor, no second value. Every monitor
|
||||
// above omits `checkProxy`, so each check runs in whatever colo the cron
|
||||
// worker was scheduled in. One vantage point cannot distinguish "the
|
||||
// service is down" from "the route from this one colo is down".
|
||||
//
|
||||
// How it actually works (worker/src/monitor.ts:361-400): `checkProxy` is
|
||||
// ONE value per monitor, not a list. Multiple regions therefore mean one
|
||||
// monitor entry PER region — which is configuration, but it multiplies
|
||||
// both the checks per minute and the rows rendered on the public page.
|
||||
// How it works (worker/src/monitor.ts:361-401): `checkProxy` is ONE
|
||||
// value per monitor, not a list. A second region therefore means one
|
||||
// extra monitor entry, not an extra field.
|
||||
// 'worker://<hint>' -> REMOTE_CHECKER_DO with a DurableObjectLocationHint:
|
||||
// wnam | enam | sam | weur | eeur | apac | oc | afr | me
|
||||
// 'globalping://...' -> Globalping probes instead of a Cloudflare DO
|
||||
//
|
||||
// Decision the owner has to make before this is switched on:
|
||||
// `checkProxyFallback: true` re-checks locally when the proxy itself
|
||||
// fails; without it a broken probe is recorded as `up: false` with
|
||||
// "Unknown check proxy error" (monitor.ts:394-400) — i.e. a probe outage
|
||||
// would be published as a service outage. Leave it true unless we want
|
||||
// the opposite.
|
||||
// `checkProxyFallback: true` is MANDATORY here, not cosmetic. Without it
|
||||
// monitor.ts:397-400 records a failure of the PROBE as `up: false` with
|
||||
// "Unknown check proxy error" — a probe outage would be published as a
|
||||
// service outage (fail-closed on the wrong axis). With it, monitor.ts:395-396
|
||||
// re-checks the target locally and the run is reported from the local
|
||||
// colo, so the page never claims a region it did not actually measure.
|
||||
//
|
||||
// {
|
||||
// id: 'website_enam',
|
||||
// name: 'Website (North America)',
|
||||
// method: 'GET',
|
||||
// target: 'https://openshopgraph.org/en/',
|
||||
// tooltip: 'Public website, checked from North America',
|
||||
// expectedCodes: [200],
|
||||
// timeout: 10000,
|
||||
// headers: { 'User-Agent': 'OSG-StatusCheck/1.0 (UptimeFlare)' },
|
||||
// checkProxy: 'worker://enam',
|
||||
// checkProxyFallback: true,
|
||||
// },
|
||||
// {
|
||||
// id: 'website_apac',
|
||||
// name: 'Website (Asia-Pacific)',
|
||||
// method: 'GET',
|
||||
// target: 'https://openshopgraph.org/en/',
|
||||
// tooltip: 'Public website, checked from Asia-Pacific',
|
||||
// expectedCodes: [200],
|
||||
// timeout: 10000,
|
||||
// headers: { 'User-Agent': 'OSG-StatusCheck/1.0 (UptimeFlare)' },
|
||||
// checkProxy: 'worker://apac',
|
||||
// checkProxyFallback: true,
|
||||
// },
|
||||
// Load — count the RPC calls, not the checks. monitor.ts:369-378 makes
|
||||
// TWO calls on the DO stub per check: `getLocationAndStatus()` and then
|
||||
// `kill()`. Cloudflare bills every RPC method call on a stub as its own
|
||||
// session, i.e. as one request. Cron is `* * * * *` (deploy.tf:64-69),
|
||||
// so this one extra monitor costs 2 x 1440 = 2,880 DO requests/day.
|
||||
// Free plan cap: 100,000 DO requests/day -> 2.88% used, and room for
|
||||
// about 34 region monitors in total, not ~69. Add them one at a time.
|
||||
{
|
||||
id: 'website_enam',
|
||||
name: 'Website (North America)',
|
||||
method: 'GET',
|
||||
target: 'https://openshopgraph.org/en/',
|
||||
tooltip: 'Public website, checked from a North American vantage point',
|
||||
statusPageLink: 'https://openshopgraph.org',
|
||||
expectedCodes: [200],
|
||||
timeout: 10000,
|
||||
headers: { 'User-Agent': 'OSG-StatusCheck/1.0 (UptimeFlare)' },
|
||||
checkProxy: 'worker://enam',
|
||||
// See above — never remove this without removing checkProxy too.
|
||||
checkProxyFallback: true,
|
||||
},
|
||||
// Further regions (apac, weur, …) stay OFF until this one has carried a
|
||||
// full window cleanly. Same shape, one entry each, fallback always true.
|
||||
// ---------------------------------------------------------------------
|
||||
],
|
||||
notification: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue