Export stellar account balance in prometheus format
Project description
Overview
The Stellar Account Prometheus Exporter retrieves account(s) balance and exposes it in prometheus format.
Configuration
Configuration file path must be provided using the --config option.
The config file is yaml formatted file:
networks:
- name: pubnet # Human readable name
horizon_url: https://horizon.example.com # Horizon URL
accounts:
- account_id: ABC123XYZ # Account ID
account_name: Account one # Human readable description
- account_id: DEF456ABC
account_name: Account two
- name: testnet
horizon_url: https://horizon-testnet.example.com
accounts:
- account_id: QWE789DEF
account_name: Testnet test account
By default the exporter listens on port 9618. This can be changes using --port switch or "PORT" environment variable.
Exported data
For each account the following metrics are exported:
- stellar_account_balance
- stellar_account_available_balance
- stellar_account_buying_liabilities
- stellar_account_selling_liabilities
- stellar_account_num_sponsored
- stellar_account_num_sponsoring
- stellar_account_scrape_success
Each metric has the following labels:
- network - network name from the configuration file
- account_id - account ID from the configuration file
- account_name - account name, as per configuration file
- asset_type - asset type
Installing from pypi
To download/test package in pypi you can use venv:
python3 -m venv venv
. venv/bin/activate
Install:
python3 -m pip install stellar_account_prometheus_exporter
Run:
./venv/bin/stellar-account-prometheus-exporter --config /path/to/config.yaml
Releasing new version
- ensure you bumped version number in setup.py. PyPi does not allow version reuse
- build new package:
python3 setup.py sdist bdist_wheel
- push to testpypi:
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
- test by installing the package (see above). If all good release:
python3 -m twine upload dist/*
Docker and K8s version
This app is now dockerized. The new Dockerfile has been validated and can be used like this:
docker build --pull --no-cache -t <your tag>
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
Built Distribution
Close
Hashes for stellar-account-prometheus-exporter-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b02dfc7632ab17d8558bb206c5d83114411642fa7ec96901f1a1291cc129da8 |
|
MD5 | de054ba015930d579cda515ef2ae9758 |
|
BLAKE2b-256 | 4ea7db635b0b56f502f3c4ac4aacface74129f68e2a3099de484fe6c783383b1 |
Close
Hashes for stellar_account_prometheus_exporter-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 957e38a022089857d9efe418fe468f0d6b186cc6fd9c1abc5aa7f849b8300194 |
|
MD5 | b4529f5abee51443108eeca27dd3b717 |
|
BLAKE2b-256 | 62de2634bfd43cad883223ee0477cd36d087e7bf0c74be25f7dad5e472ddc292 |