Skip to content

Orbit Metrics ​

Orbit Metrics is a Prometheus exporter for Cosmos SDK chains. It reads chain height, wallet balances, validator stake and on-chain parameters from each chain's REST API and serves them as metrics.

Source on GitHub · Summary on chaintools.tech · MIT licence

Requirements ​

  • Python 3 (3.8 or newer recommended)
  • A REST (LCD) endpoint for each chain — your own node or a public one such as ours

Install ​

bash
git clone https://github.com/ChainTools-Tech/orbit_metrics.git && cd orbit_metrics
python3 -m venv .venv && . .venv/bin/activate
pip install .

Configuration ​

yaml
nodes:
  - name: BitSong
    api_url: https://api.bitsong.chaintools.tech
    main_denom: ubtsg
    wallets:
      - address: bitsong1...
        type: validator
    validators:
      - validator_id: bitsongvaloper1...
KeyMeaning
nameLabel used for the chain label of every metric
api_urlREST endpoint of the chain
main_denomDenom whose balance is reported for each wallet
wallets[]address, and an optional type used as a label (default unknown)
validators[]validator_id: the validator operator address

Usage ​

bash
orbit_metrics --config config.yml --log-file orbit_metrics.log --log-level INFO
OptionDefaultMeaning
--config— (required)Configuration file
--log-fileorbit_metrics.logLog file, rewritten on start
--log-levelINFODEBUG, INFO, WARNING, ERROR or CRITICAL

Metrics are served on port 8000 and refreshed every 60 seconds; neither is configurable. Delegator Tracker also uses port 8000, so the two can't run on the same host; Cert Expiry Checker can be moved to another port. Add the exporter to Prometheus:

yaml
scrape_configs:
  - job_name: orbit_metrics
    static_configs:
      - targets: ['<HOST>:8000']

Metrics ​

All metrics are gauges. Every metric has a chain label (the configured name).

MetricExtra labelsValue
orbit_metrics_chain_heightchain_id, host (node moniker)Latest block height
orbit_metrics_wallet_balancechain_id, wallet, typeBalance in main_denom (base units)
orbit_metrics_validator_stakechain_id, validatorValidator tokens (base units)
orbit_metrics_community_taxDistribution: community tax
orbit_metrics_base_proposer_rewardDistribution: base proposer reward
orbit_metrics_bonus_proposer_rewardDistribution: bonus proposer reward
orbit_metrics_withdraw_addr_enabledDistribution: 1 if enabled, else 0
orbit_metrics_inflation_rate_changemint_denomMint: inflation rate change
orbit_metrics_inflation_maxmint_denomMint: maximum inflation
orbit_metrics_inflation_minmint_denomMint: minimum inflation
orbit_metrics_goal_bondedmint_denomMint: goal bonded ratio
orbit_metrics_blocks_per_yearmint_denomMint: blocks per year
orbit_metrics_signed_blocks_windowSlashing: signed blocks window
orbit_metrics_min_signed_per_windowSlashing: minimum signed per window
orbit_metrics_downtime_jail_durationSlashing: downtime jail duration (seconds)
orbit_metrics_slash_fraction_double_signSlashing: double-sign slash fraction
orbit_metrics_slash_fraction_downtimeSlashing: downtime slash fraction
orbit_metrics_unbonding_timebond_denomStaking: unbonding time (seconds)
orbit_metrics_max_validatorsbond_denomStaking: maximum validators
orbit_metrics_max_entriesbond_denomStaking: maximum entries
orbit_metrics_historical_entriesbond_denomStaking: historical entries
orbit_metrics_bonded_tokensStaking pool: bonded tokens
orbit_metrics_not_bonded_tokensStaking pool: not bonded tokens

The values come from the chain's cosmos/{bank,staking,distribution,mint,slashing} REST endpoints. Chains without the mint module (or with a custom one) simply don't report the mint metrics.

INFO

The metric names and labels above are taken from the code; the repository README still lists older names (orbit_*).