mcpField
C
cx-search-dashboard

cx-search-dashboard

github.com/coralogix云与 DevOps2154.1k 次安装今天更新
代码仓库

关于 cx-search-dashboard

cx-search-dashboard 是一项通过 `cx dashboards` CLI 查找 Coralogix 仪表板和组件的技能。它帮助团队在创建前检查现有内容,并查看可复用的查询模式。

主要功能

  1. 01按自然语言描述搜索仪表板
  2. 02按查询描述或字段查找组件
  3. 03列出仪表板并获取定义
  4. 04以 JSON 或 TOON 导出结果
  5. 05查看并克隆已找到的仪表板

适用场景

  1. 01检查是否已有某服务的仪表板
  2. 02查找涵盖特定监控主题的组件
  3. 03复用引用特定字段的查询
  4. 04获取仪表板定义以便修改或克隆

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/coralogix/cx-cli --skill cx-search-dashboard

安装后在 Claude Code 中输入/cx-search-dashboard确认已加载。

详细介绍

仪表板搜索技能

使用此技能,通过 cx dashboards CLI 命令进行语义搜索或基于字段的搜索,发现现有的 Coralogix 仪表板和小组件。创建新仪表板之前,务必先搜索,避免重复。

CLI 命令

命令用途关键标志
cx dashboards search "<description>"根据自然语言描述查找仪表板--limit
cx dashboards query-search --description "<text>"查找查询与描述相符的小组件--limit
cx dashboards query-search --field "<field-path>"查找引用特定字段的所有小组件--limit
cx dashboards catalog -o json列出所有仪表板-
cx dashboards get <id> -o json获取完整的仪表板定义-

**输出格式:**追加 -o json 或 -o toon,以获取机器可读的输出。

各命令的适用场景

目标命令
检查是否已有适用于某项服务或主题的仪表板cx dashboards search
查找查询涵盖你关注主题的小组件cx dashboards query-search --description
查找查询引用特定字段路径的小组件cx dashboards query-search --field
浏览所有仪表板cx dashboards catalog

示例

查找适用于某项服务的仪表板
cx dashboards search "payment service error rate"
cx dashboards search "kubernetes node cpu"
查找查询涵盖某个主题的小组件
cx dashboards query-search --description "http 5xx error rate"
cx dashboards query-search --description "p99 latency over time"
查找引用某个字段的所有小组件
cx dashboards query-search --field '$d.http.status_code'
cx dashboards query-search --field '$d.kubernetes.pod.name'

这可以展示已在使用的查询模式,便于添加新小组件时复用现有方案。

检查并克隆找到的仪表板
# Get full JSON of a dashboard you found
cx dashboards get <dashboard-id> -o json > dashboard.json
# Modify it, then create a copy
cx dashboards create --from-file dashboard.json

核心原则

  • 创建前先搜索——创建新仪表板之前,务必先运行 cx dashboards search,以避免重复
  • 使用字段搜索进行发现——cx dashboards query-search --field 会展示已有的字段查询方式,这是找到可复用 PromQL 或 DataPrime 模式最快的方法
  • 描述搜索采用模糊匹配——结果按相似度排序,而非精确匹配;如果首次搜索没有有用结果,请尝试不同的表述
  • 使用 cx dashboards get 进行检查——找到相关仪表板或小组件后,获取其完整 JSON 以了解查询结构

相关技能

  • cx-dashboards——从头构建并部署新的 Coralogix 仪表板
  • cx-telemetry-querying——搜索仪表板之前,先了解有哪些遥测字段和指标

评论

支持 Markdown