数据采集 采集源配置 华为云对象采集
华为云对象采集
简介
调用华为云ECS/OSS/RDS/SLB 列表API 采集华为云对象相关数据上报报到 DataFlux 中
前置条件
- 已安装 DataKit(DataKit 安装文档)
- 需要有阿里云帐号只读权限的 Access Key ID 和 Access Key Secret(为了保证你的数据安全,建议使用子用户授权,请不要使用超过只读权限的 Access Key ID 和 Access Key Secret)
配置
打开 DataKit 采集源配置文件夹(默认路径为 DataKit 安装目录的 conf.d
文件夹),进入 DataKit 安装目录下的 conf.d/huaweiyun 目录,复制 huaweiyunobject.conf.sample 并命名为 huaweiyunobject.conf。示例如下:
设置:
[[inputs.huaweiyunobject]]
## @param -huaweiyun authorization informations - string - required
## https://developer.huaweicloud.com/endpoint?all
region_id = "指定华为云API请求的 endpoint 地域"
access_key_id = "你的华为云帐号的 Access Key ID"
access_key_secret = "你的华为云帐号的 Access Key Secret"
project_id = "华为云操作用户的项目ID"
# ## @param - collection interval - string - optional - default: 5m
interval = '5m'
[inputs.huaweiyunobject.ecs]
## 地区和终端节点 https://developer.huaweicloud.com/endpoint?ECS
# ## @param - if has region_id, then optional; or requried
endpoint=""
## @param - [list of ecs instanceid] - optional
instanceids = []
## @param - [list of excluded ecs instanceid] - optional
exclude_instanceids = []
# 如果 pipeline 未配置,则在 pipeline 目录下寻找跟 source 同名的脚本,作为其默认 pipeline 配置
# pipeline = "huaweiyun_ecs_object.p"
#[inputs.huaweiyunobject.elb]
## elb type: 经典型、共享型、共享型_企业项目 - requried
type=""
## 地区和终端节点 https://developer.huaweicloud.com/endpoint?ELB
# ## @param - if has region_id, then optional; or requried
endpoint=""
# ## @param - [list of Elb instanceid] - optional
#instanceids = ['']
# ## @param - [list of excluded Elb instanceid] - optional
#exclude_instanceids = ['']
# 如果 pipeline 未配置,则在 pipeline 目录下寻找跟 source 同名的脚本,作为其默认 pipeline 配置
# pipeline = "huaweiyun_ecs_object.p"
[inputs.huaweiyunobject.obs]
# ## @param - if has region_id, then optional; or requried
endpoint=""
## @param - [list of oss buckets] - optional
buckets = []
## @param - [list of excluded oss instanceid] - optional
exclude_buckets = []
# 如果 pipeline 未配置,则在 pipeline 目录下寻找跟 source 同名的脚本,作为其默认 pipeline 配置
# pipeline = "huaweiyun_ecs_object.p"
#[inputs.huaweiyunobject.mysql]
## 地区和终端节点 https://developer.huaweicloud.com/endpoint?RDS
# ## @param - if has region_id, then optional; or requried
endpoint=""
# ## @param - [list of mysql instanceid] - optional
#instanceids = ['']
# ## @param - [list of excluded mysql instanceid] - optional
#exclude_instanceids = ['']
# 如果 pipeline 未配置,则在 pipeline 目录下寻找跟 source 同名的脚本,作为其默认 pipeline 配置
# pipeline = "huaweiyun_ecs_object.p"
注意:数据采集的间隔不宜过小,采集请求过于频繁会导致触发阿里云 API 请求的流控限制。采集频率如果设置为 0 表示不采集该类型的费用数据
配置好后,重启 DataKit 即可生效
对象分类--ECS
api: 查询云服务器详情列表
字段
FieldKey | 描述 | 类型 |
---|---|---|
name | instName(ID) | string |
class | 分类: huaweiyun_ecs | string |
message | 每个实例对象的详细信息 | json string |
对象分类--mysql
api: 查询数据库实例列表
字段
FieldKey | 描述 | 类型 |
---|---|---|
name | instName(instID) | string |
class | 分类: huaweiyun_mysql | string |
message | 每个实例对象的详细信息 | json string |
对象分类--OBS
api: 获取桶列表
字段
FieldKey | 描述 | 类型 |
---|---|---|
name | obs 桶 名称,如OBS_xxx | string |
class | 分类: huaweiyun_obs | string |
message | 每个实例对象的详细信息 | json string |
对象分类--ELB
api: 查询负载均衡器列表
字段
FieldKey | 描述 | 类型 |
---|---|---|
name | Name(Id) | string |
class | 分类: huaweiyun_elb | string |
message | 每个实例对象的详细信息 | json string |