Skip to main content

Alibaba Cloud CloudMonitor Prometheus exporter

Project description

Prometheus Exporter for Alibaba Cloud

Quick Start

原作者GitHub地址 代码修改:

  • 添加自定义标签
  • 根据标签push到~/metrics
  • 添加日志打印
  • 修复自定义标签自动匹配dict.key
  • 配置文件重定义,增加【global_config;metrics-team,game_name-cluster】

Installation

Python 3.5+ is required.

pip3 install alicloud-exporter

Usage

Config your credential and interested metrics:

credential:
  access_key_id: <YOUR_ACCESS_KEY_ID>
  access_key_secret: <YOUR_ACCESS_KEY_SECRET>
  region_id: <REGION_ID>

metrics:
  acs_cdn:
  - name: QPS
    team: 'team-name'
  acs_mongodb:
  - name: CPUUtilization
    period: 300
    measure: Maximum
game_name:
  dev:
  - id_qazqweasd : 二_哈
output-example:
  aliyun_acs_ecs_dashboard_DiskWriteIOPS{altype="wx",app="yyds",cluster="dev",instanceId="i-a***d",name="web",region="CN",team="abc123***"} 66.6

Run the exporter:

> aliyun-exporter -p 9525 -c aliyun-exporter.yml

The default port is 9525, default config file location is ./aliyun-exporter.yml.

Visit metrics in localhost:9525/metrics

Configuration

rate_limit: 5 # request rate limit per second. default: 10
credential:
  access_key_id: <YOUR_ACCESS_KEY_ID> # required
  access_key_secret: <YOUR_ACCESS_KEY_SECRET> # required
  region_id: <REGION_ID> # default: 'cn-hangzhou'
  
metrics: # required, metrics specifications
  acs_cdn: # required, Project Name of CloudMonitor
  - name: QPS # required, Metric Name of CloudMonitor, belongs to a certain Project
    rename: qps # rename the related prometheus metric. default: same as the 'name'
    period: 60 # query period. default: 60
    measure: Average # measure field in the response. default: Average

info_metrics:
  - ecs
  - rds
  - redis

Notes:

  • Find your target metrics using Metrics Meta
  • CloudMonitor API has an rate limit, tuning the rate_limit configuration if the requests are rejected.
  • CloudMonitor API also has an monthly quota for invocations (AFAIK, 5,000,000 invocations / month for free). Plan your usage in advance.

Given that you have 50 metrics to scrape with 60s scrape interval, about 2,160,000 requests will be sent by the exporter for 30 days.

Special Project

Some metrics are not included in the Cloud Monitor API. For these metrics, we keep the configuration abstraction consistent by defining special projects.

Special Projects:

An example configuration file of special project is provided as special-projects.yml

Note: special projects invokes different API with ordinary metrics, so it will not consume your Cloud Monitor API invocation quota. But the API of special projects could be slow, so it is recommended to separate special projects into a standalone exporter instance.

Metrics Meta

aliyun-exporter shipped with a simple site hosting the metrics meta from the CloudMonitor API. You can visit the metric meta in localhost:9525 after launching the exporter.

  • host:port will host all the available monitor projects
  • host:port/projects/{project} will host the metrics meta of a certain project
  • host:port/yaml/{project} will host a config YAML of the project's metrics

You can easily navigate in this pages by hyperlink.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alicloud-exporter-0.3.1.7.1.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

alicloud_exporter-0.3.1.7.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file alicloud-exporter-0.3.1.7.1.tar.gz.

File metadata

  • Download URL: alicloud-exporter-0.3.1.7.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

File hashes

Hashes for alicloud-exporter-0.3.1.7.1.tar.gz
Algorithm Hash digest
SHA256 a6d368c29980eab2b17e21e469bdea473a2cd21c3a5a6d9e2034a8bb700f4607
MD5 dcc443db71ad95bab677b8427548de5a
BLAKE2b-256 86a3efbc36d0dc642bedd21e048c6e11cf46dcbb0cb0425030d2f3c0eaf91d2e

See more details on using hashes here.

File details

Details for the file alicloud_exporter-0.3.1.7.1-py3-none-any.whl.

File metadata

  • Download URL: alicloud_exporter-0.3.1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

File hashes

Hashes for alicloud_exporter-0.3.1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1da5cf4f63b45aa78646358ad89eda6ad90da0b2bd7e8501da64706ba52a16e4
MD5 a41447d06ff501a3ccee3c416eb0ff20
BLAKE2b-256 ecb337eae240274bc1bd649bfc104bcd50d165aaafd3e4825ddff76c22a8566f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page