oodle-synthetic
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOodle Synthetic Monitors — HTTP / TCP Checks
Oodle合成监控——HTTP/TCP检查
This skill teaches the agent to configure synthetic monitors that actually catch failures: assertions, sane intervals, and update-without-overwrite.
本技能指导Agent配置能够有效捕获故障的合成监控,支持断言、合理检测间隔以及非覆盖式更新。
Prerequisites
前提条件
bash
brew install oodle-ai/oodle/oodle
oodle configureConfirm the synthetic-monitors endpoint works:
bash
oodle synthetic-monitors list -o json | jq 'length'bash
brew install oodle-ai/oodle/oodle
oodle configure确认synthetic-monitors端点正常工作:
bash
oodle synthetic-monitors list -o json | jq 'length'Command Execution Order
命令执行顺序
Before running any oodle command:
- Check whether the target URL or hostport is already in context.
- If not, ask the user to confirm the target.
- Test the target manually () to confirm it is reachable from the public internet.
curl -I <url> - Run .
oodle synthetic-monitors create -f monitor.json - After creation, verify the first run succeeded with .
oodle synthetic-monitors get <id> -o json
在运行任何oodle命令之前:
- 检查目标URL或hostport是否已在上下文环境中。
- 如果没有,请请求用户确认目标信息。
- 手动测试目标()以确认其可从公网访问。
curl -I <url> - 运行。
oodle synthetic-monitors create -f monitor.json - 创建完成后,使用验证首次运行是否成功。
oodle synthetic-monitors get <id> -o json
Quick Reference
快速参考
| Task | Command |
|---|---|
| List monitors | |
| Get monitor | |
| Create monitor | |
| Update monitor | |
| Delete monitor | |
| 任务 | 命令 |
|---|---|
| 列出监控 | |
| 获取监控详情 | |
| 创建监控 | |
| 更新监控 | |
| 删除监控 | |
Common Operations
常见操作
Synthetic monitor schema (HTTP)
合成监控schema(HTTP)
json
{
"name": "API health check",
"type": "http",
"target": "https://api.example.com/health",
"interval": 60,
"assertions": [
{"type": "statusCode", "value": "200"},
{"type": "responseTime", "value": "2000"}
]
}| Field | Meaning |
|---|---|
| |
| URL (HTTP) or |
| Seconds between probes; minimum 30, recommended ≥ 60 |
| |
| String form of the expected value (e.g. |
json
{
"name": "API health check",
"type": "http",
"target": "https://api.example.com/health",
"interval": 60,
"assertions": [
{"type": "statusCode", "value": "200"},
{"type": "responseTime", "value": "2000"}
]
}| 字段 | 含义 |
|---|---|
| |
| URL(HTTP)或 |
| 探测间隔(秒);最小30秒,推荐≥60秒 |
| |
| 预期值的字符串形式(例如 |
Synthetic monitor schema (TCP)
合成监控schema(TCP)
json
{
"name": "Postgres reachability",
"type": "tcp",
"target": "postgres.example.com:5432",
"interval": 60,
"assertions": [
{"type": "responseTime", "value": "1000"}
]
}json
{
"name": "Postgres reachability",
"type": "tcp",
"target": "postgres.example.com:5432",
"interval": 60,
"assertions": [
{"type": "responseTime", "value": "1000"}
]
}Creating a monitor
创建监控
bash
undefinedbash
undefined✅ CORRECT — manual reachability test, then create
✅ 正确操作 — 先手动测试可达性,再创建
curl -sSfI https://api.example.com/health
oodle synthetic-monitors create -f monitor.json
curl -sSfI https://api.example.com/health
oodle synthetic-monitors create -f monitor.json
❌ WRONG — creating against an unreachable target leaves a permanently-failing monitor
❌ 错误操作 — 针对不可达目标创建监控会导致监控持续失败
oodle synthetic-monitors create -f monitor.json
undefinedoodle synthetic-monitors create -f monitor.json
undefinedUpdating a monitor
更新监控
bash
undefinedbash
undefined✅ CORRECT — get → edit → update preserves all assertions
✅ 正确操作 — 获取→编辑→更新可保留所有断言
oodle synthetic-monitors get syn_123 -o json > monitor.json
jq '.interval = 30' monitor.json > monitor.new.json
oodle synthetic-monitors update syn_123 -f monitor.new.json
oodle synthetic-monitors get syn_123 -o json > monitor.json
jq '.interval = 30' monitor.json > monitor.new.json
oodle synthetic-monitors update syn_123 -f monitor.new.json
❌ WRONG — partial payload removes assertions
❌ 错误操作 — 部分payload会删除断言
oodle synthetic-monitors update syn_123 -f <(echo '{"interval":30}')
undefinedoodle synthetic-monitors update syn_123 -f <(echo '{"interval":30}')
undefinedDeleting a monitor
删除监控
bash
undefinedbash
undefined✅ CORRECT
✅ 正确操作
oodle synthetic-monitors get syn_123 -o json > /dev/null
oodle synthetic-monitors delete syn_123 --force
oodle synthetic-monitors get syn_123 -o json > /dev/null
oodle synthetic-monitors delete syn_123 --force
❌ WRONG — name-grep delete
❌ 错误操作 — 通过名称匹配删除
oodle synthetic-monitors delete "$(oodle synthetic-monitors list | grep health | awk '{print $1}')" --force
undefinedoodle synthetic-monitors delete "$(oodle synthetic-monitors list | grep health | awk '{print $1}')" --force
undefinedBest Practices
最佳实践
Use interval: 60
(or higher) for non-critical endpoints
interval: 60对非关键端点使用interval: 60
(或更高)
interval: 60A 10-second interval on every endpoint multiplies cost and noise. Reserve short intervals for critical user-facing flows.
bash
undefined对每个端点设置10秒间隔会增加成本和告警噪音。仅为关键用户面向流程保留短间隔。
bash
undefined✅ CORRECT — 60s interval for a /health endpoint
✅ 正确操作 — /health端点使用60秒间隔
"interval": 60
"interval": 60
❌ WRONG — 10s on dozens of internal endpoints
❌ 错误操作 — 数十个内部端点使用10秒间隔
"interval": 10
undefined"interval": 10
undefinedAlways include at least one statusCode
assertion
statusCode始终至少包含一个statusCode
断言
statusCodeA monitor with no assertions only checks TCP reachability — it will pass even if the app returns 500 to every request.
bash
undefined没有断言的监控仅检查TCP可达性——即使应用对所有请求返回500,监控仍会显示正常。
bash
undefined✅ CORRECT
✅ 正确操作
"assertions": [{"type":"statusCode","value":"200"},{"type":"responseTime","value":"2000"}]
"assertions": [{"type":"statusCode","value":"200"},{"type":"responseTime","value":"2000"}]
❌ WRONG — monitor "succeeds" on a 500 response
❌ 错误操作 — 应用返回500时监控仍显示“正常”
"assertions": []
undefined"assertions": []
undefinedAdd a responseTime
assertion to catch slow dependencies
responseTime添加responseTime
断言以捕获缓慢依赖
responseTimeA 200 response that takes 30 seconds is still a failure for users.
bash
undefined耗时30秒的200响应对用户来说仍是故障。
bash
undefined✅ CORRECT
✅ 正确操作
"assertions": [
{"type":"statusCode","value":"200"},
{"type":"responseTime","value":"2000"}
]
"assertions": [
{"type":"statusCode","value":"200"},
{"type":"responseTime","value":"2000"}
]
❌ WRONG — only checks status code, doesn't catch latency regressions
❌ 错误操作 — 仅检查状态码,无法捕获延迟回归
"assertions": [{"type":"statusCode","value":"200"}]
undefined"assertions": [{"type":"statusCode","value":"200"}]
undefinedAlways get
before update
to preserve assertions
getupdate更新前务必先get
以保留断言
getUpdate is a full-document replace.
bash
undefined更新操作是全文档替换。
bash
undefined✅ CORRECT
✅ 正确操作
oodle synthetic-monitors get syn_123 -o json > m.json
jq '.assertions += [{"type":"bodyContains","value":"ok"}]' m.json > m.new.json
oodle synthetic-monitors update syn_123 -f m.new.json
oodle synthetic-monitors get syn_123 -o json > m.json
jq '.assertions += [{"type":"bodyContains","value":"ok"}]' m.json > m.new.json
oodle synthetic-monitors update syn_123 -f m.new.json
❌ WRONG — drops assertions
and target
assertionstarget❌ 错误操作 — 会丢失assertions
和target
assertionstargetoodle synthetic-monitors update syn_123 -f <(echo '{"interval":120}')
undefinedoodle synthetic-monitors update syn_123 -f <(echo '{"interval":120}')
undefinedUse a stable name
per environment
name为每个环境使用稳定的name
nameEncode env in the name (, ) so the alert recipient knows which env to investigate.
API health check (prod)API health check (staging)bash
undefined在名称中编码环境信息(如、),以便告警接收者知晓需要排查哪个环境。
API health check (prod)API health check (staging)bash
undefined✅ CORRECT
✅ 正确操作
"name": "API health check (prod)"
"name": "API health check (prod)"
❌ WRONG
❌ 错误操作
"name": "health"
undefined"name": "health"
undefinedFailure Handling
故障处理
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or missing API key | Run |
| 404 Not Found | Synthetic monitor ID does not exist | Verify with |
| connection refused | Wrong | Check |
| Monitor permanently red | Target unreachable from the probe egress | |
| Monitor flaps | | Raise interval to 60s; raise |
| Assertions silently dropped | | Re-create from the last |
| 429 Too Many Requests | Many probes scheduled at the same second | Stagger by editing |
| 错误 | 原因 | 修复方案 |
|---|---|---|
| 401 Unauthorized | API密钥无效或缺失 | 运行 |
| 404 Not Found | 合成监控ID不存在 | 使用 |
| connection refused | | 检查 |
| 监控持续显示异常 | 探测出口无法访问目标 | 从公网执行 |
| 监控状态频繁波动 | | 将间隔提升至60秒;将 |
| 断言被静默删除 | 使用部分payload调用 | 从最近的 |
| 429 Too Many Requests | 大量探测任务被安排在同一秒执行 | 通过编辑每个监控的 |