Skip to content

Commit 4c530b8

Browse files
committed
value -> metric_value
1 parent c777d65 commit 4c530b8

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/ExamplesContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ LIMIT 100`,
8181
description: "Track process CPU utilization bucketed over time.",
8282
query: `SELECT
8383
timeBucket(),
84-
avg(value) AS avg_cpu
84+
avg(metric_value) AS avg_cpu
8585
FROM metrics
8686
WHERE metric_name = 'process.cpu.utilization'
8787
GROUP BY timeBucket
@@ -95,7 +95,7 @@ LIMIT 1000`,
9595
description: "Average memory usage per task identifier over the last 7 days.",
9696
query: `SELECT
9797
task_identifier,
98-
avg(value) AS avg_memory
98+
avg(metric_value) AS avg_memory
9999
FROM metrics
100100
WHERE metric_name = 'system.memory.usage'
101101
AND bucket_start > now() - INTERVAL 7 DAY

apps/webapp/app/v3/querySchemas.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,9 @@ export const metricsSchema: TableSchema = {
498498
coreColumn: true,
499499
}),
500500
},
501-
value: {
502-
name: "value",
501+
metric_value: {
502+
name: "metric_value",
503+
clickhouseName: "value",
503504
...column("Float64", {
504505
description: "The metric value",
505506
example: "0.75",

apps/webapp/app/v3/services/aiQueryService.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ Only use explicit \`toStartOfHour\`/\`toStartOfDay\` etc. if the user specifical
454454
- Filter by run: WHERE run_id = 'run_abc123'
455455
- Filter by task: WHERE task_identifier = 'my-task'
456456
- Available metric names: process.cpu.utilization, process.cpu.time, process.memory.usage, system.memory.usage, system.memory.utilization, system.network.io, system.network.dropped, system.network.errors, nodejs.event_loop.utilization, nodejs.event_loop.delay.p95, nodejs.event_loop.delay.max, nodejs.heap.used, nodejs.heap.total
457-
- Use \`value\` — the metric's observed value
457+
- Use \`metric_value\` — the metric's observed value
458458
- Use prettyFormat(expr, 'bytes') to tell the UI to format values as bytes (e.g., "1.50 GiB") — keeps values numeric for charts
459459
- Use prettyFormat(expr, 'percent') for percentage values
460460
- prettyFormat does NOT change the SQL — it only adds a display hint
@@ -464,7 +464,7 @@ Only use explicit \`toStartOfHour\`/\`toStartOfDay\` etc. if the user specifical
464464
465465
\`\`\`sql
466466
-- CPU utilization over time for a task
467-
SELECT timeBucket(), task_identifier, prettyFormat(avg(value), 'percent') AS avg_cpu
467+
SELECT timeBucket(), task_identifier, prettyFormat(avg(metric_value), 'percent') AS avg_cpu
468468
FROM metrics
469469
WHERE metric_name = 'process.cpu.utilization'
470470
GROUP BY timeBucket, task_identifier
@@ -474,7 +474,7 @@ LIMIT 1000
474474
475475
\`\`\`sql
476476
-- Peak memory usage per run
477-
SELECT run_id, task_identifier, prettyFormat(max(value), 'bytes') AS peak_memory
477+
SELECT run_id, task_identifier, prettyFormat(max(metric_value), 'bytes') AS peak_memory
478478
FROM metrics
479479
WHERE metric_name = 'process.memory.usage'
480480
GROUP BY run_id, task_identifier
@@ -589,7 +589,7 @@ LIMIT 1000
589589
### Common Metrics Patterns
590590
- Filter by metric: WHERE metric_name = 'process.cpu.utilization'
591591
- Available metric names: process.cpu.utilization, process.cpu.time, process.memory.usage, system.memory.usage, system.memory.utilization, system.network.io, system.network.dropped, system.network.errors, nodejs.event_loop.utilization, nodejs.event_loop.delay.p50, nodejs.event_loop.delay.p99, nodejs.event_loop.delay.max, nodejs.heap.used, nodejs.heap.total
592-
- Use \`value\` — the metric's observed value
592+
- Use \`metric_value\` — the metric's observed value
593593
- Use prettyFormat(expr, 'bytes') for memory metrics (including nodejs.heap.*), prettyFormat(expr, 'percent') for CPU utilization
594594
- prettyFormat does NOT change the SQL — it only adds a display hint for the UI
595595

0 commit comments

Comments
 (0)