关于 cx-olly
cx-olly 是通过 `cx olly` 命令行使用 Coralogix Olly Observability Agent 的技能,面向分析可观测性数据的用户。它说明如何异步发起调查、延续对话并获取生成的产物。
主要功能
- 01询问告警、指标和日志
- 02使用 chat ID 延续对话
- 03选择模型和响应超时
- 04列出并获取生成的产物
- 05输出 JSON 或 TOON 格式
适用场景
- 01调查服务延迟或错误
- 02跟进正在进行的可观测性分析
- 03获取图表或查询结果产物
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ coralogix/ cx-cli --skill cx-olly安装后在 Claude Code 中输入/cx-olly确认已加载。
详细介绍
Olly 可观测性 Agent 技能
使用此技能通过 cx olly CLI 命令与 Coralogix 的可观测性 Agent(Olly)交互。Olly 可以分析你的可观测性数据,回答有关告警、指标和日志的问题,并生成图表和报告等产物。
cx olly ask 默认将 --agent-to-agent-mode 设为 false。如果你是大模型/Agent,请传入 --agent-to-agent-mode——请参阅下文“Agent 对 Agent 模式”。
CLI 命令
| 命令 | 用途 | 关键标志 |
|---|---|---|
cx olly ask "message" | 向可观测性 Agent 发送消息 | --chat-id、--model、--timeout、--agent-to-agent-mode |
cx olly artifacts list | 列出所有已生成的产物 | - |
cx olly artifacts get <id> | 按 ID 获取产物内容 | - |
**输出格式:**追加 -o json 或 -o toon,以获取机器可读的输出。
仅支持单个配置文件:cx olly 命令不支持多配置文件扇出。使用 -p <profile> 指定单个配置文件。
运行 Olly(默认异步)
默认异步运行 cx olly ask:将其作为后台进程启动并轮询其完成状态,而不是等待它结束。Olly 的调查通常需要几分钟,因此这是运行 cx olly ask 的常规方式。
只有对于你预期 Olly 能快速回答的简短问题(例如快速查询或一行追问),才以内联方式(前台、阻塞)运行 cx olly ask。不确定时,请在后台运行。
聊天命令
开始新对话
cx olly ask "What alerts fired today?" --agent-to-agent-mode
这会创建一个新聊天,并返回回答以及可用于后续提问的聊天 ID。
如果你没有可分享的上下文(例如快速访问源文件),或者创建的聊天仅供人类使用,请移除 --agent-to-agent-mode。
继续现有聊天
cx olly ask "Tell me more about the error rates" --chat-id <chat-id> --agent-to-agent-mode
使用 --chat-id 继续对话并保留之前消息的上下文。如果后续提问会启动另一项调查,也应在后台运行。
模型选择
可用模型包括 gpt-5.2(默认)、claude-sonnet-4-5、sonnet-4.6、gpt-5.4、claude-haiku-4-5。
cx olly ask "Explain this error" --model claude-sonnet-4-5 --agent-to-agent-mode
超时
对于可能需要更长时间的复杂查询,请增加 Olly 的响应超时时间 (默认:900 秒):
cx olly ask "Deep analysis of last week's incidents" --timeout 1800 --agent-to-agent-mode
--http-timeout <SECONDS>(或 CX_HTTP_TIMEOUT)设置所有 CLI 命令(包括 Olly)的 HTTP 请求截止时间。它与 Olly 的响应超时时间相互独立。
Agent 对 Agent 模式
--agent-to-agent-mode 默认为 false,因为人类和 Agent 都会直接使用 cx olly ask。如果你是大模型/Agent,请传入 --agent-to-agent-mode,以启用更简短、类似子 Agent 的回答:不提供图表/表格,优先提出澄清问题而不是猜测,并依赖你更广泛的上下文。
cx olly ask "Analyze this for me" --agent-to-agent-mode
此标志按调用生效,而非按聊天生效。--chat-id 不会记住此设置——每轮后续对话都要重新传入 --agent-to-agent-mode,否则模式会在对话中途悄然切回面向人类的模式。
产物
Olly 可以生成查询结果、预览和引用等产物。产物 ID 会以链接形式出现在 Agent 的回复文本中。
列出所有产物
cx olly artifacts list
cx olly artifacts list -o json
获取产物内容
cx olly artifacts get <artifact-id>
cx olly artifacts get <artifact-id> -o json
artifacts get 命令会自动:
- 获取产物元数据
- 从预签名 URL 下载内容
- 解压 gzip 内容
- 解析 JSON,并对大型内容使用溢出逻辑
- 将非 JSON 文本保存到临时文件
输出行为:
- JSON 内容:直接显示;如果内容较大,则溢出到文件
- 文本内容:保存到临时文件(例如
/tmp/cx_results_artifact_<id>_<hash>.txt)
工作流示例
调查问题
# Start investigation — run in the background and poll for completion
cx olly ask "Why is the checkout service showing high latency? Check logs with 'checkout:' strings and aws related metrics" --agent-to-agent-mode
# Follow up with the chat ID from the response — also background and poll
cx olly ask "What changed in the last hour?" --chat-id abc-123-def --agent-to-agent-mode
# Once the interaction has completed, get any generated charts
cx olly artifacts list -o json | jq '.[0].id'
cx olly artifacts get <artifact-id>
获取用于脚本处理的 JSON 输出
# Get response as JSON
cx olly ask "List top 5 error messages" -o json --agent-to-agent-mode | jq '.response'
# Parse artifacts
cx olly artifacts list -o json | jq '.[] | {id, filename, created_at}'
使用指定模型进行详细分析
cx olly ask "Perform root cause analysis for the outage on 2024-01-15" \
--model claude-sonnet-4-5 \
--timeout 1800 \
--agent-to-agent-mode
核心原则
- 默认异步 - 将
cx olly ask作为后台进程运行,并轮询其完成状态;只有对于预期 Olly 能快速回答的简短问题,才以内联方式(阻塞)运行 - 聊天 ID 可提供上下文 - 保存响应中的聊天 ID,以便继续对话
- 使用
-o json进行脚本处理 - 通过管道传递给jq,以进行筛选和提取 - 工件 ID 位于响应文本中 - 查找类似
[Chart](https://...artifact_view/<id>)的 Markdown 链接 - 仅支持单个配置文件 -
cx olly不支持多配置文件查询 - 大型工件会自动溢出 - 超出配置限制的 JSON 内容会保存到临时文件
- 提问前先检查源代码 - 如果有源代码,请在调用 Olly 前提供具体上下文,例如从哪个指标开始调查
- 限制调查范围 - 引导 Olly 聚焦于正确且有限的范围,例如仅查看日志或指定时间范围
- 以大模型/Agent 身份调用时传入
--agent-to-agent-mode- 默认值为false(面向人类);Agent 应主动启用此模式,以获得更简短的子 Agent 风格响应
相关技能
cx-telemetry-querying- 用于在没有 AI Agent 协助的情况下直接执行 DataPrime/PromQL 查询(涵盖日志、追踪跨度、指标、RUM)cx-alerts- 用于管理告警定义