用途:教会智能体完整配置 Oodle 告警路由,涉及三类子系统——notifiers(告警发送目标)、notification policies(按严重度匹配与路由)、muting rules(按规定时间窗口静默)。
前置:安装并配置 CLI。 brew install oodle-ai/oodle/oodle oodle configure 可用以下命令验证三个子系统:oodle notifiers list -o json | jq 'length'、oodle notification-policies list -o json | jq 'length'、oodle muting-rules list -o json | jq 'length'。
主要能力:notifiers 封装目的地,type 为数字,配置放在对应字段,例如 0 邮件 email_config、1 PagerDuty pagerduty_config、2 Slack slack_config、3 Opsgenie、4 Webhook、5 Google Chat、6 Microsoft Teams、7 Rootly;创建后返回 UUID,策略与监控按其 id 引用。notification policies 按严重度 critical、warn、no_data、any 列出 notifier id,本身不含标签匹配器;监控通过 notifications 中的 matchers 匹配标签并路由,首个匹配的条目生效,空匹配器条目必须放在最后。muting rules 按标签匹配并在 startsAt 与 endsAt(RFC 3339)之间静默,匹配器 type:0 等于、1 不等于、2 正则匹配、3 正则不匹配。
必要用法:创建使用 oodle notifiers create -f notifier.json、oodle notification-policies create -f policy.json、oodle muting-rules create -f mute.json;删除用 <资源> delete <id> --force。muting rules 无 update,需 get、delete、create。
限制与注意:执行命令前先确认资源 ID 或名称,缺失则先用 list 命令发现,结果不明确时向用户确认,不要执行投机性命令。应先用低严重度监控测试新 notifier。删除 notifier 前先检查哪些策略与监控引用它。muting rule 应包含 _oodle_monitor_id 匹配器并设置 endsAt,不要创建开放式静默。监控通知匹配器应尽量精确,避免过宽。同一策略内按严重度做升级,不要用多个策略导致重复触发。常见错误包括 401 未授权、404 资源不存在、连接被拒、策略指向缺失 notifier、catch-all 条目未置末、Slack/PagerDuty 配置错误、429 限流(可加 --retries 3 并限速)等。