must-father_gather_metrics
普罗米修斯MCPServer克劳德代码POC
此仓库演示了如何使用以下命令从Openshift集群导出指标 must-gather -- gather_metrics
导出的指标用于创建TSDB块,并通过包含的prometheus实例公开该数据。 然后,使用Interally托管的Claude模型通过Prometheus MCP服务器查询数据。 Perses实例用于托管仪表板-您可以要求claude在Perses示例中创建仪表板。
oc adm must-gather 现在可以从给定的集群中收集指标:
oc adm must-gather -- gather_metrics \
--min-time=$(date --date='2 hours ago' +%s%3N) \
--match="{__name__=~\'etcd_.*\'}" \
--match="ALERTS{alertname=~\'.*[Ee]tcd.*\'}" \
--match="prometheus_build_info"在此仓库中运行must-gather命令或放置一个预先收集的 must-gather -- gather_metrics 将目录插入此仓库的根目录。 运行启动器将导致收集到的数据通过正在运行的容器可用
./launcher.sh现在,您可以使用自然语言查询数据:
● Great! Found the nodes with master role from 1 hour ago:
3 Master Nodes:
1. sharedocp420-sxt45-master-0
2. sharedocp420-sxt45-master-1
3. sharedocp420-sxt45-master-2A. CLAUDE.md 文件包含在repo根目录中。Claude Code在会话开始时自动加载它,提供有关数据历史性质和正确查询工作流的上下文——不需要手动启动。
此脚本涉及文件 firstrun.txt 第一次运行后,该文件包含USER_KEY、MODEL_API和MODEL_ID
