Let a pinned minute read runs from the whole day

/observability/runs gains since/until, so the throughput chart's pin asks
the server for its minute instead of filtering a fixed recent list. This
engine writes ~60 runs a minute, so any minute but the newest read empty.

since is inclusive and until exclusive, matching the minute buckets the
charts are drawn from. Hover stays the client-side preview it was:
scrubbing a day would otherwise be a request per minute rested on.
This commit is contained in:
2026-08-17 00:27:40 +02:00
parent 6ff6dabdcd
commit d6f8a60a59
7 changed files with 94 additions and 12 deletions
@@ -17,6 +17,7 @@ import {
failuresQueryOptions,
healthKeys,
minuteOf,
minuteRunsQueryOptions,
runsQueryOptions,
timeseriesQueryOptions,
} from "./queries"
@@ -174,6 +175,7 @@ export function HealthActivity() {
const { data: series } = useQuery(timeseriesQueryOptions())
const { data: runs } = useQuery(runsQueryOptions())
const { data: pinnedRuns } = useQuery(minuteRunsQueryOptions(runsAt.pinned))
const { data: failures } = useQuery(failuresQueryOptions())
const { data: audit } = useQuery(auditQueryOptions())
const { data: dead } = useQuery(deadLetterQueryOptions())
@@ -201,10 +203,16 @@ export function HealthActivity() {
): HistoryPoint[] =>
points.map((point) => ({ ts: point.ts, value: pick(point) }))
// A pin is read back from the server, so it reaches a minute the recent list
// is nowhere near deep enough to hold. A hover stays the client-side preview
// it is: scrubbing a day's chart would otherwise be a request per minute the
// pointer rests on.
const shownRuns =
runsAt.at === null
? (runs ?? []).slice(0, RUNS_SHOWN)
: (runs ?? []).filter((run) => minuteOf(run.started_at) === runsAt.at)
runsAt.pinned !== null
? (pinnedRuns ?? [])
: runsAt.at === null
? (runs ?? []).slice(0, RUNS_SHOWN)
: (runs ?? []).filter((run) => minuteOf(run.started_at) === runsAt.at)
const shownFailures =
failuresAt.at === null
? (failures ?? []).slice(0, FAILURES_SHOWN)
@@ -282,7 +290,9 @@ export function HealthActivity() {
<p className="text-sm text-muted-foreground">
{runsAt.at === null
? "No runs recorded yet."
: "No run from this minute is in the recent list."}
: runsAt.pinned !== null
? "Nothing ran in this minute."
: "No run from this minute is in the recent list."}
</p>
)}
</div>