zeabur-service-metric
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZeabur Service Metrics
Zeabur Service Metrics
Always useto invoke Zeabur CLI. Never usenpx zeabur@latestdirectly or any other installation method. Ifzeaburis not available, install Node.js first.npx
请始终使用调用Zeabur CLI。 切勿直接使用npx zeabur@latest或其他任何安装方式。如果无法使用zeabur,请先安装Node.js。npx
Check Metrics
查看指标
bash
undefinedbash
undefinedCPU usage
CPU usage
npx zeabur@latest service metric CPU --id <service-id> -i=false
npx zeabur@latest service metric CPU --id <service-id> -i=false
Memory usage
Memory usage
npx zeabur@latest service metric MEMORY --id <service-id> -i=false
npx zeabur@latest service metric MEMORY --id <service-id> -i=false
Network I/O
Network I/O
npx zeabur@latest service metric NETWORK --id <service-id> -i=false
Use `--hour <N>` to change the time window (default: 2 hours):
```bash
npx zeabur@latest service metric CPU --id <service-id> --hour 24 -i=falsenpx zeabur@latest service metric NETWORK --id <service-id> -i=false
使用 `--hour <N>` 来更改时间窗口(默认值:2小时):
```bash
npx zeabur@latest service metric CPU --id <service-id> --hour 24 -i=falseDiagnostic Workflow
诊断流程
When a user reports a slow or unresponsive service, check metrics before restarting:
bash
undefined当用户反馈服务运行缓慢或无响应时,请先检查指标再重启:
bash
undefined1. Get service ID (use the zeabur-service-list
skill)
zeabur-service-list1. 获取服务ID(使用 zeabur-service-list
技能)
zeabur-service-listnpx zeabur@latest service list --project-id <project-id> -i=false
npx zeabur@latest service list --project-id <project-id> -i=false
2. Check CPU — is the service compute-bound?
2. 检查CPU —— 服务是否受计算资源限制?
npx zeabur@latest service metric CPU --id <service-id> -i=false
npx zeabur@latest service metric CPU --id <service-id> -i=false
3. Check memory — is the service running out of RAM?
3. 检查内存 —— 服务是否内存不足?
npx zeabur@latest service metric MEMORY --id <service-id> -i=false
npx zeabur@latest service metric MEMORY --id <service-id> -i=false
4. Check network — is there unusual traffic?
4. 检查网络 —— 是否存在异常流量?
npx zeabur@latest service metric NETWORK --id <service-id> -i=false
npx zeabur@latest service metric NETWORK --id <service-id> -i=false
5. Check logs for errors (use the zeabur-deployment-logs
skill for details)
zeabur-deployment-logs5. 检查日志中的错误详情(使用 zeabur-deployment-logs
技能)
zeabur-deployment-logsnpx zeabur@latest deployment log --id <service-id> -i=false
**Then decide the action based on evidence:**
| Symptom | Likely cause | Action |
|---------|-------------|--------|
| CPU consistently near 100% | Compute-bound workload | Upgrade plan or optimize code |
| Memory climbing until OOM | Memory leak or undersized plan | Restart with `zeabur-restart` skill (temporary) + fix leak |
| Network spikes | Traffic surge or external API issues | Check logs for request patterns |
| All metrics normal | Application-level bug | Check deployment logs |npx zeabur@latest deployment log --id <service-id> -i=false
**然后根据检查结果决定操作:**
| 症状 | 可能原因 | 操作 |
|---------|-------------|--------|
| CPU持续接近100% | 计算密集型工作负载 | 升级方案或优化代码 |
| 内存持续攀升直至耗尽(OOM) | 内存泄漏或资源方案配置不足 | 使用`zeabur-restart`技能重启(临时解决)+ 修复内存泄漏 |
| 网络流量突增 | 流量激增或外部API问题 | 检查日志中的请求模式 |
| 所有指标正常 | 应用层面的bug | 检查部署日志 |