跳转至

采集器「火山云-边缘计算节点服务」配置手册

阅读本文前,请先阅读:

使用本采集器前,必须安装「观测云集成 Core 核心包」及其配套的第三方依赖包

1. 配置结构

本采集器配置结构如下:

字段 类型 是否必须 说明
regions list 必须 所需采集的地域列表
regions[#] str 必须 地域 ID。如:'cn-shanghai'
总表见附录

2. 配置示例

指定地域

采集上海地域的数据

Python
1
2
3
collector_configs = {
    'regions': ['cn-shanghai']
}

配置过滤器(可选项)

本采集器脚本支持用户自定义过滤器,让用户通过对象属性筛选出目标资源。过滤器函数返回值为 True|False

  • True:目标资源需要被采集。

  • False 目标资源不需要被采集

支持筛选的对象属性:

属性 描述
instance_identity 边缘实例的 ID
instance_uuid 边缘实例 UUID
instance_name 边缘实例名称
load_type 边缘实例的类型:
virtual_machine:虚拟机。
bare_metal:裸金属
cloud_server_identity 边缘服务的 ID
cloud_server_name 边缘服务的名称
vpc_identity 私有网络的 ID
RegionId 地域ID
Status 状态
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 示例:开启过滤器,根据对象的 Id 属性过滤,配置格式如下:
def filter_instance(instance):
    '''
    采集 instance_id 为 xxxxx 或者 instance_name 为 xxxxx 的实例
    '''
    # return True
    instance_id = instance['instance_identity']
    if instance_id in ['xxx']:
        return True
    return False


###### Do not modify the following contents #####
from guance_integration__runner import Runner
import guance_volcengine_veenedge__main as main


@DFF.API('Volcengine-VEEN Collection', timeout=3600, fixed_crontab='* * * * *')
def run():
    collectors = [
        main.DataCollector(account, collector_configs),
        # main.DataCollector(account, collector_configs, filters=[filter_instance]),
    ]
    Runner(collectors).run()

3. 数据上报格式

数据正常同步后,可以在观测云的「基础设施 / 自定义(对象)」中查看数据。

上报的数据示例如下:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  {
    "category": "custom_object",
    "fields": {
      "billing": "{边缘实例的计费配置}",
      "cluster": "{节点信息}",
      "create_time": 1712903729,
      "end_time": 0,
      "gpu": "{gpu信息}",
      "image": "{镜像信息}",
      "instance_desc": "",
      "message": "{实例 JSON 数据}",
      "monitor_agent": "{监控 Agent 的信息}",
      "network": "{实例的网络配置}",
      "secret": "{边缘实例的密码配置}",
      "spec": "veEN.xxx",
      "spec_display": "计算型 | 8C16G",
      "start_time": 1712903769,
      "storage": "{存储配置}",
      "update_time": 1712903769
    },
    "measurement": "volcengine_veenedge",
    "tags": {
      "RegionId": "cn-shanghai",
      "arch": "x86",
      "cloud_server_identity": "cloudserver-xxx",
      "cloud_server_name": "xxx",
      "cpu": "8",
      "creator": "xxx",
      "host_name": "",
      "instance_identity": "veenxxx",
      "instance_name": "",
      "instance_uuid": "xxx",
      "load_type": "virtual_machine",
      "name": "veenxxx",
      "project": "default",
      "status": "running",
      "subnet_cidr": "172.19.56.64/26",
      "vpc_identity": "vpc-xxx"
    }
  }

tags、fields 中的字段可能会随后续更新有所变动

tags.name 值为实例 ID,作为唯一标识,fields.billing、fields.cluster、fields.gpu、fields.image、fields.message、fields.monitor_agent、fields.network、fields.secret、fields.storage 均为 JSON 序列化后字符串

X. 附录

请参考火山云官方文档: