Add hadoop input plugin to categraf #1137
Merged
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.
Add hadoop input plugin to categraf
feat: Add Hadoop input plugin to Categraf
PR 描述
新增功能
此 PR 新增了一个 Hadoop 监控插件,支持通过 JMX 接口采集 Hadoop 集群中以下组件的监控指标:
配置说明
插件的配置文件位于
conf/input.hadoop/hadoop.toml
,支持以下配置项:通用配置
组件配置
每个组件的配置通过
[[components]]
块定义,支持以下字段:name
:组件名称(如YarnResourceManager
)。port
:JMX 端口。processName
:进程名称,用于动态判断是否需要采集该组件的指标。allowRecursiveParse
:是否递归解析 JMX 返回的 JSON 数据。allowMetricsWhiteList
:是否启用白名单。jmxUrlSuffix
:JMX URL 后缀。white_list
:需要采集的指标名称列表。示例配置:
白名单的作用
white_list
用于指定需要采集的指标名称。插件会根据白名单中的指标名称从 JMX 接口中提取对应的数据。processName
判断当前机器是否有该进程,如果有则自动采集白名单中的指标。allowRecursiveParse
,插件会递归解析 JMX 返回的 JSON 数据,并采集白名单中的指标。测试
已通过以下测试:
相关 Issue
#1136)
代码变更
新增文件
plugins/inputs/hadoop/hadoop.go
:Hadoop 插件的核心实现。conf/input.hadoop/hadoop.toml
:Hadoop 插件的配置文件模板。plugins/inputs/hadoop/README.md
:Hadoop 插件的使用文档。修改文件
plugins/inputs/inputs.go
:注册 Hadoop 插件。