mcpField
Z
zeabur-service-metric

zeabur-service-metric

github.com/zeabur云与 DevOps39156 次安装7 周前更新
代码仓库

关于 zeabur-service-metric

zeabur-service-metric 是用于查看 Zeabur 服务 CPU、内存和网络指标的技能,也提供先检查指标再处理服务迟缓或无响应问题的诊断流程。

主要功能

  1. 01查看 CPU 使用情况
  2. 02查看内存使用情况
  3. 03查看网络 I/O
  4. 04调整指标时间范围
  5. 05指导基于指标的诊断

适用场景

  1. 01排查运行缓慢的服务
  2. 02重启前检查内存使用
  3. 03区分资源压力与应用问题

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/zeabur/agent-skills --skill zeabur-service-metric

安装后在 Claude Code 中输入/zeabur-service-metric确认已加载。

详细介绍

Zeabur 服务指标

**始终使用 npx zeabur@latest 调用 Zeabur CLI。**切勿直接使用 zeabur 或通过其他方式安装。如果无法使用 npx,请先安装 Node.js。

查看指标

# CPU usage
npx zeabur@latest service metric CPU --id <service-id> -i=false

# Memory usage
npx zeabur@latest service metric MEMORY --id <service-id> -i=false

# Network I/O
npx zeabur@latest service metric NETWORK --id <service-id> -i=false

使用 --hour <N> 更改时间范围(默认:2 小时):

npx zeabur@latest service metric CPU --id <service-id> --hour 24 -i=false

诊断工作流

当用户报告服务运行缓慢或无响应时,请先查看指标,再重启:

# 1. Get service ID (use the `zeabur-service-list` skill)
npx zeabur@latest service list --project-id <project-id> -i=false

# 2. Check CPU — is the service compute-bound?
npx zeabur@latest service metric CPU --id <service-id> -i=false

# 3. Check memory — is the service running out of RAM?
npx zeabur@latest service metric MEMORY --id <service-id> -i=false

# 4. Check network — is there unusual traffic?
npx zeabur@latest service metric NETWORK --id <service-id> -i=false

# 5. Check logs for errors (use the `zeabur-deployment-logs` skill for details)
npx zeabur@latest deployment log --id <service-id> -i=false

然后根据证据决定采取的措施:

症状可能原因措施
CPU 持续接近 100%计算密集型工作负载升级方案或优化代码
内存持续增长直至 OOM内存泄漏或方案配置不足使用 zeabur-restart skill 重启(临时措施),并修复泄漏
网络流量激增流量激增或外部 API 问题检查日志中的请求模式
所有指标均正常应用层 Bug检查部署日志

评论

支持 Markdown