A Prometheus exporter for the Azure billing API
Project description
[![Build Status](https://travis-ci.org/blue-yonder/azure-cost-mon.svg?branch=master)](https://travis-ci.org/blue-yonder/azure-cost-mon)
[![Coverage Status](https://coveralls.io/repos/github/blue-yonder/azure-cost-mon/badge.svg?branch=master)](https://coveralls.io/github/blue-yonder/azure-cost-mon?branch=master)
[![PyPI version](https://badge.fury.io/py/azure-costs-exporter.svg)](https://badge.fury.io/py/azure-costs-exporter)
ACE azure-costs-exporter
========================
Prometheus exporter for the Microsoft Azure billing API. Check out
[this blog post](https://tech.blue-yonder.com/public-cloud-cost-control/) for
more background about the idea and some nice screenshots.
Description
-----------
**azure-costs-exporter** is a web app, that is intended to be called by [Prometheus](https://prometheus.io) to export billing information from Azure. It will then return the available metrics in Prometheus compatible format.
The billing API in use is part of the "Enterprise Agreement (EA)" Portal. Hence, it is not available for pay-as-you-go
subscriptions. The configuration requires an active EA with Microsoft.
Configuration
-------------
You need to create an `application.cfg` file with the following content:
ENROLLMENT_NUMBER="123456"
BILLING_API_ACCESS_KEY="XXX"
PROMETHEUS_METRIC_NAME="my_metric_name"
- `ENROLLMENT_NUMBER` is the unique ID that identifies a particular EA.
- The `BILLING_API_ACCESS_KEY` can be created in the [EA portal](https://ea.azure.com/) to gain
access to the billing API. Navigate to "Reports > Download Usage" and generate an API Access Key.
- `PROMETHEUS_METRIC_NAME` is the name of the time series that will be generated in Prometheus.
Deployment
----------
E.g. via `gunicorn`. In an activated `virtualenv`, you can do:
pip install azure-costs-exporter gunicorn
cp /path/to/application.cfg .
gunicorn azure_costs_exporter:app
Tests
-----
The used python testing tool is [pytest](https://docs.pytest.org/en/latest/).
To run the tests:
```bash
mkvirtualenv billing
pip install -r requirements_dev.txt
pip install -e .
py.test
```
[![Coverage Status](https://coveralls.io/repos/github/blue-yonder/azure-cost-mon/badge.svg?branch=master)](https://coveralls.io/github/blue-yonder/azure-cost-mon?branch=master)
[![PyPI version](https://badge.fury.io/py/azure-costs-exporter.svg)](https://badge.fury.io/py/azure-costs-exporter)
ACE azure-costs-exporter
========================
Prometheus exporter for the Microsoft Azure billing API. Check out
[this blog post](https://tech.blue-yonder.com/public-cloud-cost-control/) for
more background about the idea and some nice screenshots.
Description
-----------
**azure-costs-exporter** is a web app, that is intended to be called by [Prometheus](https://prometheus.io) to export billing information from Azure. It will then return the available metrics in Prometheus compatible format.
The billing API in use is part of the "Enterprise Agreement (EA)" Portal. Hence, it is not available for pay-as-you-go
subscriptions. The configuration requires an active EA with Microsoft.
Configuration
-------------
You need to create an `application.cfg` file with the following content:
ENROLLMENT_NUMBER="123456"
BILLING_API_ACCESS_KEY="XXX"
PROMETHEUS_METRIC_NAME="my_metric_name"
- `ENROLLMENT_NUMBER` is the unique ID that identifies a particular EA.
- The `BILLING_API_ACCESS_KEY` can be created in the [EA portal](https://ea.azure.com/) to gain
access to the billing API. Navigate to "Reports > Download Usage" and generate an API Access Key.
- `PROMETHEUS_METRIC_NAME` is the name of the time series that will be generated in Prometheus.
Deployment
----------
E.g. via `gunicorn`. In an activated `virtualenv`, you can do:
pip install azure-costs-exporter gunicorn
cp /path/to/application.cfg .
gunicorn azure_costs_exporter:app
Tests
-----
The used python testing tool is [pytest](https://docs.pytest.org/en/latest/).
To run the tests:
```bash
mkvirtualenv billing
pip install -r requirements_dev.txt
pip install -e .
py.test
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for azure_costs_exporter-0.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b6eb069ed6d23f910cb96476f9d648886c9267054301a48146afccb8e39f11 |
|
MD5 | ed0d747bf0904dc8363502d0d80dcdbe |
|
BLAKE2b-256 | 90ff07399de7d38ec201692202feb07e3a5c53b0feee959182e1c869968a8aa0 |
Close
Hashes for azure_costs_exporter-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f034dbb9ef19044745c144f626eb3368b5f0836b5205c7a14ce5b2358fa20e0e |
|
MD5 | ae02d73a58725aeed3416a0384b90ecd |
|
BLAKE2b-256 | 8c75ec50fd9fdc819255161759a2448be44a589ebc222bc5bc1390556317574e |
Close
Hashes for azure_costs_exporter-0.3.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e57974c791e8fc7b824cc3168377ebb273121867d03b30f957938d4ddfa13956 |
|
MD5 | f4f10bd168dc28e7aa14b838b941c989 |
|
BLAKE2b-256 | 52822db8276bcde07992a2bd7c764f44abbd20b212f77866eff296713f991795 |