Monitoring APIs 技能:用 Prometheus 区分就绪与存活
EnglishClaude Code 安装步骤
- 从 GitHub 固定提交获取完整的 `plugins/api-development/api-monitoring-dashboard/skills/monitoring-apis` 目录。
- 复制到目标项目的 `.claude/skills/`,确认 `.claude/skills/monitoring-apis/SKILL.md`,再从项目根目录启动 Claude Code,输入 `/monitoring-apis`。
中文摘要
用 Claude Code 为自己维护的 API 接入请求计数、响应耗时和健康端点,让仪表板能看出启动阶段的状态变化。
SKILL.md 中文导读
可复现示例
设置本地服务在依赖初始化期间返回 /health=200、/ready=503。初始化完成后再次读取,发送两个不同 ID 的商品查询并查看请求指标。工作步骤
- 定义 /health 与 /ready 的不同检查。请求计数按路由模板、方法和状态分类,避免商品 ID 造成标签爆炸。
- 在应用启动前后采样就绪端点,再发合成请求检查指标值变化和分组。
验收方法
就绪端点变为 200。两个商品请求计入同一个模板路由指标,仪表板可以显示请求数量。
GitHub 原文 · 更新日期
适用环境
准备一个本地测试 API 和项目支持的 Prometheus 指标库。可选本地 Prometheus 与 Grafana。
常见问题
要把完整 URL 作为 Prometheus 标签吗?
使用稳定的路由模板。完整路径和查询值会生成大量指标序列,也可能带入私有数据。
相关指南
相关推荐
groq-install-auth 技能
jeremylongshore/claude-code-plugins-plus-skills
anima-common-errors 技能
jeremylongshore/claude-code-plugins-plus-skills
apple-notes-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
castai-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
cohere-local-dev-loop 技能
jeremylongshore/claude-code-plugins-plus-skills
figma-security-basics 技能
jeremylongshore/claude-code-plugins-plus-skills