observe-metrics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseObserve Metrics
观测指标
Aggregate counters, gauges, and histograms from the observability namespace and flag anomalies.
聚合来自可观测性命名空间的计数器、仪表盘和直方图,并标记异常。
When to use
使用场景
When you need a snapshot of system health -- task completion rates, error rates, active agent counts, memory usage, and token consumption. Useful for monitoring swarm performance and detecting degradation.
当你需要系统健康状况的快照时——任务完成率、错误率、活跃Agent数量、内存使用情况和令牌消耗情况。这对于监控集群性能和检测性能下降非常有用。
Steps
步骤
- Retrieve metrics -- call to fetch metric records from the
mcp__claude-flow__agentdb_hierarchical-recallnamespace for the specified period (default: 1 hour)observability - Aggregate -- compute:
- Counters: sum totals (tasks_completed, errors, token_usage)
- Gauges: current values (active_agents, memory_usage_bytes)
- Histograms: p50, p95, p99 (task_duration_ms, span_duration_ms)
- Compute baselines -- search for historical patterns via to establish baseline values for each metric
mcp__claude-flow__agentdb_pattern-search - Flag anomalies -- mark metrics deviating >2 standard deviations from baseline with direction (above/below) and severity
- Store patterns -- call to record current metric snapshot for future baseline comparison
mcp__claude-flow__agentdb_pattern-store - Report -- display: metric name, current value, baseline, deviation, trend (up/down/stable), anomaly flag; overall health score (green/yellow/red)
- 获取指标——调用从
mcp__claude-flow__agentdb_hierarchical-recall命名空间获取指定时间段(默认:1小时)的指标记录observability - 聚合计算——计算:
- 计数器:总和(已完成任务数、错误数、令牌使用量)
- 仪表盘:当前值(活跃Agent数、内存使用字节数)
- 直方图:p50、p95、p99分位数(任务持续时间毫秒、跨度持续时间毫秒)
- 计算基线——通过搜索历史模式,为每个指标建立基线值
mcp__claude-flow__agentdb_pattern-search - 标记异常——将偏离基线超过2个标准差的指标标记出来,并标注方向(高于/低于)和严重程度
- 存储模式——调用记录当前指标快照,用于未来基线对比
mcp__claude-flow__agentdb_pattern-store - 生成报告——显示:指标名称、当前值、基线值、偏差、趋势(上升/下降/稳定)、异常标记;整体健康评分(绿色/黄色/红色)
CLI alternative
CLI替代方案
bash
npx @claude-flow/cli@latest memory search --query "system metrics for last hour" --namespace observabilitybash
npx @claude-flow/cli@latest memory search --query "system metrics for last hour" --namespace observability