fix: update UI metric names from JMX to Micrometer convention
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 2m34s
CI / docker (push) Successful in 2m3s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 53s

Agent team migrated from JMX to Micrometer metrics. Update the 5
hardcoded metric names in AgentInstance.tsx JVM charts:
- jvm.cpu.process → process.cpu.usage.value
- jvm.memory.heap.used → jvm.memory.used.value
- jvm.memory.heap.max → jvm.memory.max.value
- jvm.threads.count → jvm.threads.live.value
- jvm.gc.time → jvm.gc.pause.total_time

Server backend is unaffected (generic MetricsSnapshot storage).
CLAUDE.md updated with full agent metric name reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-12 18:35:29 +02:00
parent dc29afd4c8
commit 0b19fe8319
2 changed files with 49 additions and 10 deletions

View File

@@ -57,18 +57,18 @@ export default function AgentInstance() {
// Stat card metrics (latest 1 bucket)
const { data: latestMetrics } = useAgentMetrics(
agent?.instanceId || null,
['jvm.cpu.process', 'jvm.memory.heap.used', 'jvm.memory.heap.max'],
['process.cpu.usage.value', 'jvm.memory.used.value', 'jvm.memory.max.value'],
1,
);
const cpuPct = latestMetrics?.metrics?.['jvm.cpu.process']?.[0]?.value;
const heapUsed = latestMetrics?.metrics?.['jvm.memory.heap.used']?.[0]?.value;
const heapMax = latestMetrics?.metrics?.['jvm.memory.heap.max']?.[0]?.value;
const cpuPct = latestMetrics?.metrics?.['process.cpu.usage.value']?.[0]?.value;
const heapUsed = latestMetrics?.metrics?.['jvm.memory.used.value']?.[0]?.value;
const heapMax = latestMetrics?.metrics?.['jvm.memory.max.value']?.[0]?.value;
const memPct = heapMax ? (heapUsed! / heapMax) * 100 : undefined;
// Chart metrics (60 buckets)
const { data: jvmMetrics } = useAgentMetrics(
agent?.instanceId || null,
['jvm.cpu.process', 'jvm.memory.heap.used', 'jvm.memory.heap.max', 'jvm.threads.count', 'jvm.gc.time'],
['process.cpu.usage.value', 'jvm.memory.used.value', 'jvm.memory.max.value', 'jvm.threads.live.value', 'jvm.gc.pause.total_time'],
60,
);
@@ -102,25 +102,25 @@ export default function AgentInstance() {
// JVM chart series helpers
const cpuSeries = useMemo(() => {
const pts = jvmMetrics?.metrics?.['jvm.cpu.process'];
const pts = jvmMetrics?.metrics?.['process.cpu.usage.value'];
if (!pts?.length) return null;
return [{ label: 'CPU %', data: pts.map((p: any, i: number) => ({ x: i, y: p.value * 100 })) }];
}, [jvmMetrics]);
const heapSeries = useMemo(() => {
const pts = jvmMetrics?.metrics?.['jvm.memory.heap.used'];
const pts = jvmMetrics?.metrics?.['jvm.memory.used.value'];
if (!pts?.length) return null;
return [{ label: 'Heap MB', data: pts.map((p: any, i: number) => ({ x: i, y: p.value / (1024 * 1024) })) }];
}, [jvmMetrics]);
const threadSeries = useMemo(() => {
const pts = jvmMetrics?.metrics?.['jvm.threads.count'];
const pts = jvmMetrics?.metrics?.['jvm.threads.live.value'];
if (!pts?.length) return null;
return [{ label: 'Threads', data: pts.map((p: any, i: number) => ({ x: i, y: p.value })) }];
}, [jvmMetrics]);
const gcSeries = useMemo(() => {
const pts = jvmMetrics?.metrics?.['jvm.gc.time'];
const pts = jvmMetrics?.metrics?.['jvm.gc.pause.total_time'];
if (!pts?.length) return null;
return [{ label: 'GC ms', data: pts.map((p: any, i: number) => ({ x: String(i), y: p.value })) }];
}, [jvmMetrics]);