跳转至

采集器「AWS-Neptune 集群采集」配置手册

阅读本文前,请先阅读:

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

1. 配置结构

本采集器配置结构如下:

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

2. 配置示例

采集北京地域的实例数据

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

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
{
  "measurement": "aws_neptune_cluster",
  "tags": {
    "DBClusterArn"                  : "arn:aws-cn:rds:cn-north-1::cluster:",
    "DBClusterIdentifier"           : "hn-test",
    "DBSubnetGroup"                 : "default-vpc-",
    "DbClusterResourceId"           : "cluster-JM35ME",
    "Engine"                        : "neptune",
    "EngineVersion"                 : "1.2.0.2",
    "HostedZoneId"                  : "Z027FQJY5",
    "MasterUsername"                : "admin",
    "RegionId"                      : "cn-north-1",
    "Status"                        : "available",
    "name"                          : "hn-test"
  },
  "fields": {
    "AvailabilityZones"              : "[\"cn-north-1a\", \"cn-north-1b\", \"cn-north-1d\"]",
    "BackupRetentionPeriod"          : 1,
    "ClusterCreateTime"              : "2023-08-18T09:23:29.611000Z",
    "CopyTagsToSnapshot"             : false,
    "DBClusterMembers"               : "[{\"DBClusterParameterGroupStatus\": \"in-sync\", \"DBInstanceIdentifier\": \"hn-test-instance-1\", \"IsClusterWriter\": true, \"PromotionTier\": 1}]",
    "DBClusterOptionGroupMemberships": "null",
    "DBClusterParameterGroup"        : "default.neptune1.2",
    "EarliestRestorableTime"         : "2023-08-18T09:24:24.384000Z",
    "Endpoint"                       : ".neptune.cn-north-1.amazonaws.com.cn",
    "LatestRestorableTime"           : "2023-08-18T09:51:15.785000Z",
    "MultiAZ"                        : false,
    "PendingModifiedValues"          : "null",
    "Port"                           : 8182,
    "PreferredBackupWindow"          : "11:55-12:25",
    "PreferredMaintenanceWindow"     : "wed:08:13-wed:08:43",
    "ReaderEndpoint"                 : ".neptune.cn-north-1.amazonaws.com.cn",
    "StorageEncrypted"               : false,
    "VpcSecurityGroups"              : "[{\"Status\": \"active\", \"VpcSecurityGroupId\": \"sg-088b699dac95f5da9\"}]",
    "message"                        : "{实例 JSON 数据}"
  }
}

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

4. IAM 策略权限

如果用户使用带入 IAM 角色的方式采集资源,需要开启一定的操作权限

该采集器需要以下权限:

rds:DescribeDBClusters

X. 附录

请参考 AWS 官方文档: