Skip to content

feat(inputs): 新增海光 GPU hy_smi 采集插件#1453

Merged
kongfei605 merged 2 commits into
flashcatcloud:mainfrom
dujianxin:feature/hy-smi
Jun 10, 2026
Merged

feat(inputs): 新增海光 GPU hy_smi 采集插件#1453
kongfei605 merged 2 commits into
flashcatcloud:mainfrom
dujianxin:feature/hy-smi

Conversation

@dujianxin

Copy link
Copy Markdown
Contributor

新增 hy_smi 输入插件,通过执行 hy-smi 命令并解析其 JSON 输出来采集海光 GPU 监控指标。

变更内容:

  • 新增 inputs/hy_smi/hy_smi.go:插件核心实现
  • 新增 conf/input.hy_smi/hy_smi.toml:默认配置文件
  • 新增 inputs/hy_smi/README.md:插件使用文档
  • 在 agent/metrics_agent.go 中注册 hy_smi 插件

采集指标包括 GPU 温度(边缘/结点/显存/核心)、HCU 利用率、显存使用率、电压以及 GPU 信息标签。支持本地执行和远程SSH 执行两种方式,可配置采集超时时间。

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 为 Categraf 新增了一个用于采集海光(Hygon)GPU 指标的输入插件 hy_smi:通过执行 hy-smi --json 并解析输出,上报温度、利用率、显存使用率、电压以及基础信息标签等指标,并在 agent 中完成插件注册。

Changes:

  • 新增 inputs/hy_smi 插件实现:执行命令、解析 JSON、生成 samples 上报
  • 新增默认配置模板 conf/input.hy_smi/hy_smi.toml
  • 新增插件使用文档 inputs/hy_smi/README.md,并在 agent/metrics_agent.go 注册插件

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
inputs/hy_smi/hy_smi.go 实现 hy-smi 命令执行与 JSON 解析,将字段映射为指标并上报
conf/input.hy_smi/hy_smi.toml 提供 hy_smi 插件的默认配置模板
inputs/hy_smi/README.md 说明插件用途、配置、指标列表与示例输出
agent/metrics_agent.go 通过匿名 import 注册 hy_smi 输入插件

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread inputs/hy_smi/hy_smi.go
Comment thread inputs/hy_smi/hy_smi.go
Comment thread conf/input.hy_smi/hy_smi.toml
@kongfei605

Copy link
Copy Markdown
Collaborator

Thank you @dujianxin

@kongfei605 kongfei605 merged commit 19fdb8f into flashcatcloud:main Jun 10, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants