diff --git a/src/app/api/cron/health-check/route.ts b/src/app/api/cron/health-check/route.ts index 0c5d2c48..7892bede 100644 --- a/src/app/api/cron/health-check/route.ts +++ b/src/app/api/cron/health-check/route.ts @@ -1,7 +1,7 @@ import { timingSafeEqual } from "node:crypto"; import { NextResponse, type NextRequest } from "next/server"; import { getBenchmarkSlugs } from "@/data/benchmarks"; -import { getSpecs } from "@/lib/spec"; +import { getSpecs, loadAllBenchmarks } from "@/lib/spec"; import { extractMetricName, Prometheus } from "@/lib/prometheus"; export const runtime = "nodejs"; @@ -214,12 +214,28 @@ export async function GET(req: NextRequest) { } } + // Pre-warm the per-bench unstable_cache + KV snapshot layer. This + // single call is what spares an unlucky cold-start user a draft render + // when Prom is slow: it keeps each bench's runtime-cache entry fresh + // and triggers a writeSnapshot to KV so the snapshot fallback always + // has a recent good value to surface. Failures are caught so a Prom + // hiccup here doesn't 500 the cron and lose the Slack alert. + let prewarmCount = 0; + let prewarmErr: string | undefined; + try { + const benches = await loadAllBenchmarks(); + prewarmCount = benches.length; + } catch (err) { + prewarmErr = err instanceof Error ? err.message : String(err); + } + return NextResponse.json({ checked: liveSpecs.length, transitions: transitions.length, sent: sent.length, dryRun: !webhook, transitionsList: transitions, + prewarm: { count: prewarmCount, err: prewarmErr }, }); } diff --git a/src/components/provider-logo.tsx b/src/components/provider-logo.tsx index 23615371..edc9cd5d 100644 --- a/src/components/provider-logo.tsx +++ b/src/components/provider-logo.tsx @@ -68,6 +68,13 @@ const NEEDS_LIGHT_CHIP = new Set([ "relay", "debridge", "tonapi", + // Dark/single-tone logos that need a white chip to read on the page bg: + "1rpc", + "blocknative", + "lava", + "tenderly", + "jito", + "astralane", ]); function Chip({ diff --git a/src/lib/prometheus.ts b/src/lib/prometheus.ts index f9186f70..92afbd02 100644 --- a/src/lib/prometheus.ts +++ b/src/lib/prometheus.ts @@ -17,8 +17,13 @@ type PromEnvelope = | { status: "success"; data: T; warnings?: string[] } | { status: "error"; errorType: string; error: string }; -/** Default timeout for Prometheus queries. keep short, build time is finite. */ -const DEFAULT_TIMEOUT_MS = 4_000; +/** Default timeout for Prometheus queries. Bumped 4s → 10s after staging + * logs showed `quantile_over_time(0.99, …[24h])` consistently taking + * 4-8s under load (observed 2026-05-26), which would otherwise abort + * the query and collapse the bench to a draft render. 10s is the safe + * upper bound for our heaviest percentile-over-window queries while + * still bounding the SSR render at a tolerable ceiling. */ +const DEFAULT_TIMEOUT_MS = 10_000; export class Prometheus { constructor(public readonly baseUrl: string) {