GithubHelp home page GithubHelp logo

stellar / stellar-account-prometheus-exporter Goto Github PK

View Code? Open in Web Editor NEW
3.0 8.0 6.0 60 KB

Stellar Account Prometheus Exporter - Monitor Stellar Network Accounts

License: Apache License 2.0

Python 94.03% Dockerfile 5.97%

stellar-account-prometheus-exporter's Introduction

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>

stellar-account-prometheus-exporter's People

Contributors

brahman81 avatar jacekn avatar marcelosalloum avatar mwtzzz avatar satyamz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stellar-account-prometheus-exporter's Issues

Feature Request: handle missing accounts better

What problem does your feature solve?

It improves robustness

What would you like to see?

Currently when the exporter can't get data from horizon for any accounts it does not return any data.
This can be handled better. It should return data for all accounts it can reach and it should return metrics about error for failed ones.

What alternatives are there?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.