Skip to content

Repository files navigation

Orbit Metrics

Overview

Orbit Metrics is a monitoring tool for Cosmos-based blockchains that collects and exports key metrics related to chain height, wallet balances, validator stakes, and various parameters. It is designed to work seamlessly with Prometheus, allowing for easy visualization and analysis of blockchain data.

Features

  • Fetch chain height and ID from multiple nodes
  • Monitor wallet balances for specific addresses
  • Collect validator stake amounts
  • Retrieve and expose blockchain parameters from various APIs
  • Compatible with Prometheus for metrics collection

Installation

  1. Clone the repository:
 git clone https://github.com/YourUsername/orbit_metrics.git
cd orbit_metrics
  1. Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`

` 3. Install Orbit Metrics and all required packages:

pip install .

Configuration

Before running the exporter, you need to create a configuration file named config.yml. Below is an example configuration file:

nodes:
- name: BitSongapi_url: http://api.bitsong.commain_denom: ubtsgwallets:
- address: bitsong_wallet_addresstype: validatorvalidators:
- validator_id: bitsongvaloper1...
- name: Sentinelapi_url: http://api.sentinel.commain_denom: sentineldenomwallets:
- address: sentinel_wallet_addresstype: savingsvalidators:
- validator_id: sentinelvaloper1...

Configuration Fields

nodes: A list of blockchain nodes to monitor.
name: A friendly name for the node.
api_url: The base URL of the API endpoint.
main_denom: The main denomination used for the blockchain.
wallets: A list of wallets to monitor.
address: The address of the wallet.
type: Type of wallet (e.g., validator, savings).
validators: A list of validators to monitor.
validator_id: The ID of the validator.

Usage

Run the exporter using the command line:

python -m orbit_metrics --config config.yml --log-file orbit_metrics.log --log-level DEBUG

Command-Line Options

--config: Path to the configuration file.
--log-file: Path to the log file.
--log-level: Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL).

Metrics

The exporter exposes the following metrics to Prometheus:

Metric NameLabel(s)DescriptionData Type
orbit_chain_heightchain, chain_id, monikerCurrent height of the blockchain.Gauge
orbit_wallet_balancechain, chain_id, wallet, typeBalance of the specified wallet address.Gauge
orbit_validator_stakechain, chain_id, validator, monikerAmount of stake for the specified validator.Gauge
orbit_community_taxchain, monikerCommunity tax rate for the chain.Gauge
orbit_base_proposer_rewardchain, monikerBase proposer reward rate for the chain.Gauge
orbit_bonus_proposer_rewardchain, monikerBonus proposer reward rate for the chain.Gauge
orbit_withdraw_addr_enabledchain, monikerIndicator of whether withdrawal addresses are enabled.Gauge
orbit_mint_inflation_rate_changechain, mint_denom, monikerInflation rate change for minting.Gauge
orbit_slashing_signed_blocks_windowchain, monikerSigned blocks window for slashing.Gauge
orbit_staking_unbonding_timechain, bond_denom, monikerUnbonding time for staked tokens (in seconds).Gauge
orbit_staking_pool_bonded_tokenschain, monikerAmount of bonded tokens in the staking pool.Gauge
orbit_staking_pool_not_bonded_tokenschain, monikerAmount of not bonded tokens in the staking pool.Gauge

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Internal tag: 021

About

Cosmos-SDK based blockchain data exporter for Prometheus.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages