Export nano_node stats for prometheus
Project description
nano-prom
A simple metrics exporter for a nano-node daemon
Requirements
- python 3.7+ https://www.python.org/downloads/
Installation
pip3 install nano-prom-exporter
Usage
nano-prom [-h] [--rpchost RPCHOST] [--rpc_port rpc_port] [--datapath DATAPATH] [--push_gateway push_gateway] [--hostname JOBNAME] [--interval SEC] [--username USERNAME] [--password PASSWORD] [--config_path PATH/TO/config.ini]
| Optional Arguments | |||
|---|---|---|---|
| -h, --help | show this help message and exit | ||
| --rpchost | RPCHOST | "[::1]" | default host string |
| --rpc_port | rpc_port | "7076" | default rpc port |
| --datapath | DATAPATH | "~/Nano/" | as default |
| --push_gateway | push_gateway | "http://localhost:9091" | prometheus push gateway, for multiple use config.ini and --config_path |
| --hostname | JOBNAME | socket.gethostname() | jobname to pass to gateway |
| --interval | SEC | "10" | seconds between pushing |
| --username | USERNAME | "" | http_basic_auth username, for multiple use config.ini and --config_path |
| --password | PASSWORD | "" | http_basic_auth password, for multiple use config.ini and --config_path |
| --config_path | PATH/TO/config.ini | "" | path to config.ini for multiple push gateway and basic_auth support |
Sample config.ini
[DEFAULT]
rpcIP = localhost ; ip for rpc
rpcPort = 7076 ; port for rpc
nodeDataPath = ~/Nano/ ; path to Nano Directory
hostname = testing ; hostname will default to socket.gethostname if not configured
interval = 10 ; default 10 seconds
;example showing push gateway with no auth
[http://127.0.0.1:9091] ; push gateway full url and port
;example showing push gateway with basic_auth
[http://127.0.0.1:9092] ; push gateway full url and port
username = test ; username for basic auth
password = testing ; password for basic auth
Stats exposed:
| Source | Prometheus Series{tag} | Info |
|---|---|---|
| rpc | nano_rpc_response | histogram of rpc response by action |
| nano_active_difficulty | Active Difficulty Multiplier | |
| nano_active_difficulty_receive | Active Difficulty Receive Multiplier | |
| nano_block_count{type} | Block Count Statistics | |
| nano_confirmation_history{count} | Block Confirmation Average{count sample size} | |
| nano_node_frontier_count | Frontier Count | |
| nano_node_quorum_delta | Quorum Delta From Confirmation Quorum | |
| nano_node_online_stake_total | Online Stake Total | |
| nano_node_peers_stake_total | Peered Stake Total | |
| nan_node_trended_stake_total | Trended Stake Total | |
| nano_node_peer_count | raw peer count | |
| nano_uptime | node uptime(sec) | |
| nano_version | version string | |
| nano_stats_counters{type, detail, dir} | stats counter entries by type detail and direction | |
| nano_stats_objects_count{l1,l2,l3} | stats object count {l1,l2,l3} | |
| nano_stats_objects_size{l1,l2,l3} | stats object size {l1,l2,l3} | |
| telemetry_raw_blocks | raw telemetry block count by endpoint | |
| telemetry_raw_cemented | raw telemetry cemented count by endpoint | |
| telemetry_raw_unchecked | raw telemetry unchecked count by endpoint | |
| telemetry_raw_accounts | raw telemetry account count by endpoint | |
| telemetry_raw_bandwidth | raw telemetry bandwidth cap by endpoint | |
| telemetry_raw_peer | raw telemetry peer count by endpoint | |
| telemetry_raw_protocol | raw telemetry protocol version by endpoint | |
| telemetry_raw_major | raw telemetry major version by endpoint | |
| telemetry_raw_minor | raw telemetry minor version by endpoint | |
| telemetry_raw_patch | raw telemetry patch version by endpoint | |
| telemetry_raw_pre | raw telemetry pre-release version by endpoint | |
| telemetry_raw_uptime | raw telemetry uptime by endpoint | |
| telemetry_raw_maker | raw telemetry maker by endpoint | |
| telemetry_raw_timestamp | raw telemetry received timestamp by endpoint |
|system|nano_node_memory_rss{pid}|allocated and in ram|
| |nano_node_cpu_usage{pid}|percentage CPU usage|
| |nano_node_threads{pid,tid}|percentage of total CPU per thread id |
| |nano_node_database|size of database(bytes)|
| |nano_node_volume_free|size of volume hosting DATAPATH free|
| |nano_node_volume_used|size of volume hosting DATAPATH used|
| |nano_node_volume_total|size of volume hosting DATAPATH total|
| |nano_node_memory_vms{pid}|all memory used|
| |nano_node_memory_paged_pool{pid}| |
Development Requirements:
- prometheus-client
pip3 install prometheus-client - requests
pip3 install requests - psutil
pip3 install psutil
Development Installation using venv:
python3 -m venv venv. /venv/bin/activatepip install -r requirements.txtpip3 install -e .from repo root
DEBUGGING
Setting NANO_PROM_DEBUG to 1 will print exceptions, useful for debugging
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nano_prom_exporter-0.1.12.tar.gz.
File metadata
- Download URL: nano_prom_exporter-0.1.12.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45316593569ff8a4f5facba5d95fb314e301926fff5e3818ee1353e5d28f5e97
|
|
| MD5 |
061b99c35b6bc4605ea38fe87a53c656
|
|
| BLAKE2b-256 |
5cbc116da0071a5634db0ce23e8bf86db733aa9597a4cc36f732b495bf3c7496
|
File details
Details for the file nano_prom_exporter-0.1.12-py3.9.egg.
File metadata
- Download URL: nano_prom_exporter-0.1.12-py3.9.egg
- Upload date:
- Size: 9.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1f4433996bdf13830d26cf2e1c82972e6caf00716bea11bf457cfe46262abc
|
|
| MD5 |
9d625e11ab6f67e13507d1b0bb6ad352
|
|
| BLAKE2b-256 |
abf7676ac7a3ae4f9bb2ccfcb830945ddf103bded7cce1c28c56249a2148a0eb
|
File details
Details for the file nano_prom_exporter-0.1.12-py3.8.egg.
File metadata
- Download URL: nano_prom_exporter-0.1.12-py3.8.egg
- Upload date:
- Size: 19.0 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68b97e2369046131d4f88a7fcc24983f85d70189871954443a8d62064e85d3c5
|
|
| MD5 |
c9f79e81eb069225dd7e0138c550f22b
|
|
| BLAKE2b-256 |
074ebe06e25176dba8860f2b19e7267efdad5fb011fbeb62f023f3bd77f66e25
|
File details
Details for the file nano_prom_exporter-0.1.12-py3.7.egg.
File metadata
- Download URL: nano_prom_exporter-0.1.12-py3.7.egg
- Upload date:
- Size: 18.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2b549316d297b32a58256b2c999f38ab2704c152860bc333580096e834bf864
|
|
| MD5 |
3e50e2c1668cee0528ce8373f3e2f998
|
|
| BLAKE2b-256 |
e8a223a01518fec6e3c63d271692400228070fb699b570679307aefe563a4d64
|
File details
Details for the file nano_prom_exporter-0.1.12-py3-none-any.whl.
File metadata
- Download URL: nano_prom_exporter-0.1.12-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6904227fd2c3b691ff272aae5ff54d64a3335b1fb52aa35c4c18e40813d9c37a
|
|
| MD5 |
04fc8b751a334aec09429022b4b73dea
|
|
| BLAKE2b-256 |
0354b50484f32dec8cf35708d924479bc4e246abb58e2da80befe18d7212b7b3
|