Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3f1731f
feat(metrics-pipeline): generic Redis-stream to ClickHouse metrics pi…
ericallam Jul 2, 2026
33562f5
feat(clickhouse): queue metrics tables and read queries
ericallam Jul 2, 2026
a3a2434
feat(run-engine): emit queue depth, throughput, and scheduling-delay …
ericallam Jul 2, 2026
c206e12
feat(webapp): queue metrics ingestion, admin controls, and emission s…
ericallam Jul 2, 2026
3581326
feat(tsql): opt-in gap-fill for time-bucketed series
ericallam Jul 2, 2026
2f294d3
feat(webapp): Queues dashboard and per-org metrics UI flag
ericallam Jul 2, 2026
412a385
chore(webapp): add server-changes note for queue metrics
ericallam Jul 2, 2026
7a26ca5
chore: apply oxfmt formatting
ericallam Jul 3, 2026
26e6972
chore: use import type for type-only imports
ericallam Jul 3, 2026
05a01df
fix(tsql): avoid polynomial backtracking in ORDER BY direction strip
ericallam Jul 3, 2026
6846079
fix(tsql): strip ORDER BY direction without a backtracking regex
ericallam Jul 3, 2026
635c9c7
fix(clickhouse): remove semicolons from queue metrics migration comments
ericallam Jul 3, 2026
6d2a357
test(clickhouse): rewrite queue metrics test for cumulative counters
ericallam Jul 3, 2026
5f6b7db
fix(metrics-pipeline): use BigInt order keys and namespaced odometer …
ericallam Jul 3, 2026
b3893a7
fix(clickhouse): filter zero waits from quantile view and accept stri…
ericallam Jul 3, 2026
5139255
fix(webapp): fail open on queue metrics and honor sparkline total ove…
ericallam Jul 3, 2026
9e8a8d7
test(run-engine): import describe from vitest in run-queue metrics test
ericallam Jul 3, 2026
ad3668b
fix(tsql): skip gap-fill on descending bucket order
ericallam Jul 3, 2026
e925979
fix(metrics-pipeline): widen order_key packing factor to 1e6
ericallam Jul 3, 2026
69600b3
feat(webapp,clickhouse): standard time filter for queue metrics pages
ericallam Jul 4, 2026
d4edb4c
fix(tsql): register the deltaSumTimestampMerge aggregate
ericallam Jul 4, 2026
b1dded7
chore(webapp): use shared primitives on the admin queue metrics page
ericallam Jul 4, 2026
5c372a1
feat(webapp): house style hero charts on the queues list
ericallam Jul 4, 2026
9f4f5e9
feat(clickhouse): queue activity ranking queries
ericallam Jul 4, 2026
ea0a4b2
feat(webapp): queue allocation view and relevance-ordered queue list
ericallam Jul 4, 2026
5e04145
fix(tsql): inject time fallbacks into FROM subqueries
ericallam Jul 4, 2026
d527796
feat(clickhouse,tsql): queue metrics rollups and single-scan ranking
ericallam Jul 4, 2026
7c77040
feat(webapp): serve queue metrics reads from rollups and fix env totals
ericallam Jul 4, 2026
5c7f7af
feat(clickhouse,webapp): keep 10-second resolution on the env metrics…
ericallam Jul 4, 2026
9f603ae
fix(webapp): include rollup tables in the queue metrics simulator reset
ericallam Jul 4, 2026
15e0e5f
fix(webapp): update the queue metrics simulator for cumulative counters
ericallam Jul 4, 2026
4be8159
feat(webapp): stage fake Redis usage from the queue metrics simulator
ericallam Jul 4, 2026
9bd77e8
fix(webapp): keep the search filter on the ranked queue list's tail
ericallam Jul 5, 2026
5d0cce5
fix(metrics-pipeline): drop metric emits while the metrics Redis is n…
ericallam Jul 5, 2026
1ed93e7
feat(webapp): remove auto-balance from the allocation view
ericallam Jul 5, 2026
2b866b8
feat(tsql,webapp): reject cross-queue merges of per-queue counter states
ericallam Jul 5, 2026
9c3b077
refactor(clickhouse,webapp): use the stored quantile list in all merg…
ericallam Jul 5, 2026
74f1979
fix(tsql): satisfy the tenant column type in the merge guard test schema
ericallam Jul 5, 2026
b8b4f2e
fix(clickhouse): dedup retried metric batches in the MV target tiers
ericallam Jul 5, 2026
465b361
fix(webapp,metrics-pipeline): review hardening for overflow counters,…
ericallam Jul 5, 2026
fcc27bc
feat(run-engine,clickhouse,webapp): concurrency-key health metrics an…
ericallam Jul 5, 2026
9233032
feat(webapp,run-engine,clickhouse,tsql): per-concurrency-key queue me…
ericallam Jul 5, 2026
046fcda
feat(webapp): move concurrency-key metrics to a tab on the queue deta…
ericallam Jul 5, 2026
c17b1cd
feat(webapp,tsql): hide the per-key metrics table from user-facing qu…
ericallam Jul 5, 2026
b53fbdb
fix(run-engine): anchor scheduling delay to the current queue stint o…
ericallam Jul 5, 2026
9781651
feat(webapp): surface queue metrics on task detail and run inspector
ericallam Jul 5, 2026
61931ab
chore(webapp): remove trailing blank line flagged by oxfmt
ericallam Jul 5, 2026
ddae31f
refactor(webapp): flatten the run inspector queue block and tab the t…
ericallam Jul 6, 2026
b666663
fix(clickhouse): renumber queue-metrics migration to 036 to avoid a v…
ericallam Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/queue-metrics-dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: feature
---

Queue metrics and health on the Queues page: per-queue depth, throughput, concurrency, throttling, and scheduling-delay charts, plus a per-queue detail view, live queue stats and a backlog chart on the task detail page, and a waiting-in-queue explainer in the run inspector for runs that have not started yet. Off by default; enabled per organization.
24 changes: 18 additions & 6 deletions apps/webapp/app/components/primitives/UsageSparkline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ export type UsageSparklineProps = {
color?: string;
/** Unit shown in the tooltip (e.g. calls, tokens). */
unitLabel?: UnitLabel;
/** Trailing scalar shown after the chart. Defaults to the sum of buckets (override for gauges, e.g. peak). */
total?: number;
/** Format the trailing total. Defaults to `toLocaleString`. */
formatTotal?: (total: number) => string;
/** Class for the trailing total label. */
totalClassName?: string;
/** Size of the bar chart. Defaults to the list-cell size (`h-6 w-28`). */
chartClassName?: string;
/** Hide the trailing total (e.g. when the caller shows its own headline). */
hideTotal?: boolean;
};

/**
Expand All @@ -44,14 +50,18 @@ export function UsageSparkline({
bucketIntervalMs,
color = "var(--color-pending)",
unitLabel = { singular: "call", plural: "calls" },
total: totalOverride,
formatTotal,
totalClassName = "text-blue-400",
chartClassName = "h-6 w-28",
hideTotal = false,
}: UsageSparklineProps) {
if (!data || data.every((v) => v === 0)) {
const hasTotalOverride = totalOverride !== undefined;
if (!data || data.length === 0 || (data.every((v) => v === 0) && !hasTotalOverride)) {
return <span className="text-text-dimmed">–</span>;
}

const total = data.reduce((a, b) => a + b, 0);
const total = totalOverride ?? data.reduce((a, b) => a + b, 0);
const max = Math.max(...data);

// Map each bucket to a dated point so the tooltip can show the window it
Expand All @@ -66,7 +76,7 @@ export function UsageSparkline({

return (
<div className="flex items-start gap-2">
<div className="h-6 w-28 rounded-sm">
<div className={cn("rounded-sm", chartClassName)}>
<ResponsiveContainer width="100%" height="100%">
<BarChart data={chartData} margin={{ top: 0, right: 0, left: 0, bottom: 0 }}>
<YAxis domain={[0, max || 1]} hide />
Expand Down Expand Up @@ -96,9 +106,11 @@ export function UsageSparkline({
</BarChart>
</ResponsiveContainer>
</div>
<span className={cn("-mt-1 text-xs tabular-nums", totalClassName)}>
{formatTotal ? formatTotal(total) : total.toLocaleString()}
</span>
{hideTotal ? null : (
<span className={cn("-mt-1 text-xs tabular-nums", totalClassName)}>
{formatTotal ? formatTotal(total) : total.toLocaleString()}
</span>
)}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/components/primitives/charts/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const ChartTooltipContent = React.forwardRef<
)}
<div
className={cn(
"flex flex-1 justify-between leading-none",
"flex flex-1 justify-between gap-3 leading-none",
nestLabel ? "items-end" : "items-center"
)}
>
Expand Down
53 changes: 52 additions & 1 deletion apps/webapp/app/components/primitives/charts/ChartLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CartesianGrid,
Line,
LineChart,
ReferenceLine,
XAxis,
YAxis,
type XAxisProps,
Expand Down Expand Up @@ -48,12 +49,38 @@ export type ChartLineRendererProps = {
tooltipLabelFormatter?: (label: string, payload: any[]) => string;
/** Optional formatter for numeric tooltip values (e.g. bytes, duration) */
tooltipValueFormatter?: (value: number) => string;
/** Draw a dot at each data point. Defaults to true; turn off for dense/compact charts. */
showDots?: boolean;
/** Horizontal reference lines (e.g. limits); the y-domain extends to include them. */
referenceLines?: Array<{ y: number; label?: string; color?: string }>;
/** Width injected by ResponsiveContainer */
width?: number;
/** Height injected by ResponsiveContainer */
height?: number;
};

/** Reference-line label: right-aligned just below the line (recharts injects viewBox). */
function ReferenceLineLabel({
viewBox,
value,
}: {
viewBox?: { x: number; y: number; width: number };
value: string;
}) {
if (!viewBox) return null;
return (
<text
x={viewBox.x + viewBox.width - 4}
y={viewBox.y + 12}
textAnchor="end"
fill="#878C99"
fontSize={10}
>
{value}
</text>
);
}

/**
* Line chart renderer for the compound component system.
* Must be used within a Chart.Root.
Expand All @@ -73,6 +100,8 @@ export function ChartLineRenderer({
stacked = false,
tooltipLabelFormatter,
tooltipValueFormatter,
showDots = true,
referenceLines,
width,
height,
}: ChartLineRendererProps) {
Expand Down Expand Up @@ -176,6 +205,17 @@ export function ChartLineRenderer({
labelFormatter={tooltipLabelFormatter}
/>
{/* Note: Legend is now rendered by ChartRoot outside the chart container */}
{referenceLines?.map((line) => (
<ReferenceLine
key={`ref-${line.y}-${line.label ?? ""}`}
y={line.y}
stroke={line.color ?? "#4D525B"}
strokeDasharray="4 4"
strokeWidth={1}
ifOverflow="extendDomain"
label={line.label ? <ReferenceLineLabel value={line.label} /> : undefined}
/>
))}
{visibleSeries.map((key) => (
<Area
key={key}
Expand Down Expand Up @@ -222,14 +262,25 @@ export function ChartLineRenderer({
labelFormatter={tooltipLabelFormatter}
/>
{/* Note: Legend is now rendered by ChartRoot outside the chart container */}
{referenceLines?.map((line) => (
<ReferenceLine
key={`ref-${line.y}-${line.label ?? ""}`}
y={line.y}
stroke={line.color ?? "#4D525B"}
strokeDasharray="4 4"
strokeWidth={1}
ifOverflow="extendDomain"
label={line.label ? <ReferenceLineLabel value={line.label} /> : undefined}
/>
))}
{visibleSeries.map((key) => (
<Line
key={key}
dataKey={key}
type={lineType}
stroke={config[key]?.color}
strokeWidth={1}
dot={{ r: 1.5, fill: config[key]?.color, strokeWidth: 0 }}
dot={showDots ? { r: 1.5, fill: config[key]?.color, strokeWidth: 0 } : false}
activeDot={{ r: 4 }}
isAnimationActive={false}
/>
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/app/components/query/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import type { action as titleAction } from "~/routes/resources.orgs.$organizatio
import type { QueryScope } from "~/services/queryService.server";
import { downloadFile, rowsToCSV, rowsToJSON } from "~/utils/dataExport";
import { organizationBillingPath } from "~/utils/pathBuilder";
import { querySchemas } from "~/v3/querySchemas";
import { visibleQuerySchemas } from "~/v3/querySchemas";

/** Convert a Date or ISO string to ISO string format */
function toISOString(value: Date | string): string {
Expand Down Expand Up @@ -245,7 +245,7 @@ const QueryEditorForm = forwardRef<
<TSQLEditor
defaultValue={query}
onChange={setQuery}
schema={querySchemas}
schema={visibleQuerySchemas}
linterEnabled={true}
showCopyButton={true}
showClearButton={true}
Expand Down
Loading