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_limitconfiguration 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:
rds_performance: RDS performance metrics, available metric names: Performance parameter table
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:portwill host all the available monitor projectshost:port/projects/{project}will host the metrics meta of a certain projecthost:port/yaml/{project}will host a config YAML of the project's metrics
You can easily navigate in this pages by hyperlink.
Metadata
Release files for alicloud-exporter 0.3.1.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alicloud-exporter-0.3.1.7.1.tar.gz | 14.0 kB | Without provenance | Details for alicloud-exporter-0.3.1.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alicloud_exporter-0.3.1.7.1-py3-none-any.whl | Python 3 | none | any | Details for alicloud_exporter-0.3.1.7.1-py3-none-any.whl |
Total release size: 33.7 kB
Release files / alicloud-exporter-0.3.1.7.1.tar.gz
| Download URL | alicloud-exporter-0.3.1.7.1.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6d368c29980eab2b17e21e469bdea473a2cd21c3a5a6d9e2034a8bb700f4607
|
|
BLAKE2b-256 checksum How to use checksums |
86a3efbc36d0dc642bedd21e048c6e11cf46dcbb0cb0425030d2f3c0eaf91d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / alicloud_exporter-0.3.1.7.1-py3-none-any.whl
| Download URL | alicloud_exporter-0.3.1.7.1-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1da5cf4f63b45aa78646358ad89eda6ad90da0b2bd7e8501da64706ba52a16e4
|
|
BLAKE2b-256 checksum How to use checksums |
ecb337eae240274bc1bd649bfc104bcd50d165aaafd3e4825ddff76c22a8566f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for alicloud-exporter 0.3.1.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.