fix: update UI metric names from JMX to Micrometer convention
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:
41
CLAUDE.md
41
CLAUDE.md
@@ -335,6 +335,45 @@ Server exposes `/api/v1/prometheus` (unauthenticated, Prometheus text format). S
|
||||
|
||||
All containers also get `prometheus.scrape=true`. These labels enable Prometheus `docker_sd_configs` auto-discovery.
|
||||
|
||||
### Agent Metric Names (Micrometer)
|
||||
|
||||
Agents send `MetricsSnapshot` records with Micrometer-convention metric names. The server stores them generically (ClickHouse `agent_metrics.metric_name`). The UI references specific names in `AgentInstance.tsx` for JVM charts.
|
||||
|
||||
**JVM metrics (used by UI):**
|
||||
|
||||
| Metric name | UI usage |
|
||||
|---|---|
|
||||
| `process.cpu.usage.value` | CPU % stat card + chart |
|
||||
| `jvm.memory.used.value` | Heap MB stat card + chart (tags: `area=heap`) |
|
||||
| `jvm.memory.max.value` | Heap max for % calculation (tags: `area=heap`) |
|
||||
| `jvm.threads.live.value` | Thread count chart |
|
||||
| `jvm.gc.pause.total_time` | GC time chart |
|
||||
|
||||
**Camel route metrics (stored, queried by dashboard):**
|
||||
|
||||
| Metric name | Type | Tags |
|
||||
|---|---|---|
|
||||
| `camel.exchanges.succeeded.count` | counter | `routeId`, `camelContext` |
|
||||
| `camel.exchanges.failed.count` | counter | `routeId`, `camelContext` |
|
||||
| `camel.exchanges.total.count` | counter | `routeId`, `camelContext` |
|
||||
| `camel.exchanges.failures.handled.count` | counter | `routeId`, `camelContext` |
|
||||
| `camel.route.policy.count` | count | `routeId`, `camelContext` |
|
||||
| `camel.route.policy.total_time` | total | `routeId`, `camelContext` |
|
||||
| `camel.route.policy.max` | gauge | `routeId`, `camelContext` |
|
||||
| `camel.routes.running.value` | gauge | — |
|
||||
|
||||
Mean processing time = `camel.route.policy.total_time / camel.route.policy.count`. Min processing time is not available (Micrometer does not track minimums).
|
||||
|
||||
**Cameleer agent metrics:**
|
||||
|
||||
| Metric name | Type | Tags |
|
||||
|---|---|---|
|
||||
| `cameleer.chunks.exported.count` | counter | `instanceId` |
|
||||
| `cameleer.chunks.dropped.count` | counter | `instanceId`, `reason` |
|
||||
| `cameleer.sse.reconnects.count` | counter | `instanceId` |
|
||||
| `cameleer.taps.evaluated.count` | counter | `instanceId` |
|
||||
| `cameleer.metrics.exported.count` | counter | `instanceId` |
|
||||
|
||||
## Disabled Skills
|
||||
|
||||
- Do NOT use any `gsd:*` skills in this project. This includes all `/gsd:` prefixed commands.
|
||||
@@ -342,7 +381,7 @@ All containers also get `prometheus.scrape=true`. These labels enable Prometheus
|
||||
<!-- gitnexus:start -->
|
||||
# GitNexus — Code Intelligence
|
||||
|
||||
This project is indexed by GitNexus as **cameleer3-server** (6012 symbols, 15283 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
This project is indexed by GitNexus as **cameleer3-server** (6021 symbols, 15284 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
|
||||
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
||||
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user