v1.4.0 — AgentCore 仪表板 + CloudWatch 指标集成
· 阅读需 3 分钟
本版本新增 AgentCore 仪表板页面、4 个服务的 CloudWatch 指标表,并包含 Resource Inventory(PR #1)。
核心新增
AgentCore 仪表板 · Sign Out · 4 个 CloudWatch 指标 API · Resource Inventory · S3 Bucket Map
AgentCore 仪表板(/agentcore)
可一目了然地掌握 Bedrock AgentCore Runtime 与 8 个 Gateway 状态的专用仪表板。
- Runtime 状态:通过
data/config.json的agentRuntimeArn查询状态 - 8 个 Gateway 卡片:显示各 Gateway 的状态、工具数、主要功能
- 125 个工具完整列表:支持搜索、按 Gateway 过滤
- 架构图:可视化 Runtime → Gateway → Lambda 关系
API 端点
/api/agentcore(src/app/api/agentcore/route.ts)从 data/config.json 读取 ARN,并通过 AWS API 查询状态。没有硬编码的账户信息,只需修改 config 即可在任何环境中运行。
Sign Out 功能
在 Header 中添加了退出登录按钮,可安全地终止 Cognito 会话。
| 项目 | Before | After |
|---|---|---|
| 退出登录 | 不可用(只能关闭浏览器) | Header 退出登录按钮 |
| Cookie 删除 | document.cookie(无法访问 HttpOnly) | POST /api/auth 服务端删除 |
| 认证状态 | 依赖浏览器缓存 | 强制 Cognito 重新认证 |
HttpOnly Cookie 删除
无法通过 document.cookie 删除 HttpOnly Cookie。
必须通过服务端 API(src/app/api/auth/route.ts)返回 Set-Cookie: token=; Max-Age=0。
CloudWatch 指标表(4 个服务)
为 4 个服务添加了专用 API 路由和 CloudWatch 指标表。全部采用相同模式(cloudwatch get-metric-data → 进度条 + 数值)。
| 服务 | API 路由 | 指标 |
|---|---|---|
| MSK | /api/msk | 各 Broker 的 CPU、Memory、BytesIn、BytesOut |
| RDS | /api/rds | 各实例的 CPU、Memory、Connections、IOPS |
| ElastiCache | /api/elasticache | 各节点的 CPU、Memory、Network、Connections + Valkey 引擎卡片 |
| OpenSearch | /api/opensearch | 各域的 CPU、JVM Memory、Cluster Status、Search Rate |
Resource Inventory (PR #1)
在 /inventory 页面监控 18 类资源数量的变化趋势。
- 多折线图:各资源数量变化的时间序列
- 成本影响估算:显示资源变化带来的预计费用
src/lib/resource-inventory.ts:基于快照(data/inventory/),零额外查询- Cost Explorer 可用性:通过
checkCostAvailability()自动判别 MSP Payer
S3 / RDS / ElastiCache 强化
| 服务 | 新增功能 |
|---|---|
| S3 | Bucket Map(TreeMap 可视化)、搜索/过滤、显示 IAM Roles |
| RDS | Security Groups 标签页、CloudWatch 迷你图表、Features 详情 |
| ElastiCache | Security Groups 标签页、CloudWatch 指标、Valkey 引擎支持 |
Monitoring 强化
- 实例详细指标视图:Date Range 选择(1h ~ 30d)
- Resource Topology:Graph/Map View 切换(React Flow)