feat(inputs): 新增海光 GPU hy_smi 采集插件#1453
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
Collaborator
|
Thank you @dujianxin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增 hy_smi 输入插件,通过执行 hy-smi 命令并解析其 JSON 输出来采集海光 GPU 监控指标。
变更内容:
采集指标包括 GPU 温度(边缘/结点/显存/核心)、HCU 利用率、显存使用率、电压以及 GPU 信息标签。支持本地执行和远程SSH 执行两种方式,可配置采集超时时间。