一个支持多云平台账户余额监控的 Prometheus 导出器,支持阿里云、华为云、腾讯云、火山引擎、百度智能云和京东云。
- 阿里云余额监控
- 华为云余额监控
- 腾讯云余额监控
- 火山引擎余额监控
- 百度智能云余额监控
- 京东云余额监控
- 多账户支持
- 余额阈值告警
- Prometheus 指标导出
cloud:
# 阿里云配置
alibaba:
- name: "alibaba-account-1"
access_key: "你的阿里云AccessKey"
secret_key: "你的阿里云SecretKey"
enabled: true
balance_threshold: 1000.0 # 余额告警阈值(元)
# 华为云配置
huawei:
- name: "huawei-account-1"
access_key: "你的华为云AccessKey"
secret_key: "你的华为云SecretKey"
enabled: true
balance_threshold: 1000.0 # 余额告警阈值(元)
# 腾讯云配置
tencent:
- name: "tencent-account-1"
access_key: "你的腾讯云SecretId"
secret_key: "你的腾讯云SecretKey"
region: "ap-shanghai" # 地域,可选,默认ap-shanghai
enabled: true
balance_threshold: 10.0 # 余额告警阈值(元)
# 火山引擎配置
volcengine:
- name: "volcengine-account-1"
access_key: "你的火山引擎AccessKey"
secret_key: "你的火山引擎SecretKey"
enabled: true
balance_threshold: 1000.0 # 余额告警阈值(元)
# 百度智能云配置
baidu:
- name: "baidu-account-1"
access_key: "你的百度智能云AccessKey"
secret_key: "你的百度智能云SecretKey"
enabled: true
balance_threshold: 1000.0 # 余额告警阈值(元)
# 京东云配置
jdcloud:
- name: "jdcloud-account-1"
access_key: "你的京东云AccessKey"
secret_key: "你的京东云SecretKey"
enabled: true
balance_threshold: 1000.0 # 余额告警阈值(元)每个云平台都支持配置多个账户:
cloud:
tencent:
- name: "tencent-main-account"
access_key: "主账户SecretId"
secret_key: "主账户SecretKey"
region: "ap-shanghai"
enabled: true
balance_threshold: 50.0
- name: "tencent-sub-account"
access_key: "子账户SecretId"
secret_key: "子账户SecretKey"
region: "ap-beijing"
enabled: true
balance_threshold: 20.0# 使用默认配置
./cloud_balance_exporter
# 使用自定义配置文件
./cloud_balance_exporter -c=/path/to/your/config.yaml
# 指定端口
./cloud_balance_exporter -p=9090访问 http://localhost:8081/metrics 查看导出的指标:
cloud_account_balance{account_id="",account_type="tencent",account_name="tencent-account-1",currency="CNY"} 1.0
cloud_account_balance_status{account_id="",account_type="tencent",account_name="tencent-account-1"} 1
状态说明:
1:正常(余额 ≥ 阈值)0:异常(余额 < 阈值)