/aliyun-exporter

Exporter for Aliyun CloudMonitor

Primary LanguageGo

Aliyun CloudMonitor Exporter

exporter for Aliyun CloudMonitor. Written in Golang, inspired by aliyun-exporter.

Develop

git clone https://github.com/fengxsong/aliyun-exporter
cd aliyun-exporter
make tidy

Build

# Binary
make bin
# docker image
make docker-build

Usage

make bin
# print example of config
./build/_output/bin/aliyun-exporter print-config --ak xxxx --secret xxxx [NAMESPACES...]
# run
./build/_output/bin/aliyun-exporter serve [--config=/path/of/config]

Deploy

Docker-compose

Pre-requisites:

  • Docker
  • docker-compose
# copy and modify example.yaml first
cd deploy
docker-compose up -d

Kubernetes

Pre-requisites:

  • Kubernetes
  • helm
helm install -n monitoring aliyun-exporter deploy/aliyun-exporter
kubectl get po -n monitoring -w

prometheus job

- job_name: 'aliyun-exporter'
  scrape_interval: 60s
  scrape_timeout: 60s
  static_configs:
  - targets: ['aliyun-exporter:9527']
    labels:
      account_name: xxxx
      provider: aliyun # or aliyun_jst

prometheus rules

sample file

Limitation

  • an exporter instance can only scrape metrics from single region
  • ...

TODO

  • dynamic rate limiter
  • grafana dashboard

Ref