zeabur-service-metric

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Service Metrics

Zeabur Service Metrics

Always use
npx zeabur@latest
to invoke Zeabur CLI.
Never use
zeabur
directly or any other installation method. If
npx
is not available, install Node.js first.
请始终使用
npx zeabur@latest
调用Zeabur CLI。
切勿直接使用
zeabur
或其他任何安装方式。如果无法使用
npx
,请先安装Node.js。

Check Metrics

查看指标

bash
undefined
bash
undefined

CPU 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=false
npx 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=false

Diagnostic Workflow

诊断流程

When a user reports a slow or unresponsive service, check metrics before restarting:
bash
undefined
当用户反馈服务运行缓慢或无响应时,请先检查指标再重启
bash
undefined

1. Get service ID (use the
zeabur-service-list
skill)

1. 获取服务ID(使用
zeabur-service-list
技能)

npx 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)

5. 检查日志中的错误详情(使用
zeabur-deployment-logs
技能)

npx 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 | 检查部署日志 |