This is a Prometheus exporter for Solana validators that supports monitoring multiple validators across different networks (mainnet, testnet, devnet).
- Multi-Network Support: Monitor validators on mainnet, testnet, and devnet simultaneously
- Multi-Validator Support: Monitor multiple validators per network
- Comprehensive Metrics: Track validator performance, financial metrics, and network statistics
- Network Labels: All metrics include network and vote account labels for easy identification
-
Create a configuration file.
Copy the
config.example.yamltoconfig.yamland update the values:cp config.example.yaml config.yaml
Then, edit
config.yaml:port: The port the exporter will listen on (e.g.,9090).
rpc_url_mainnet: The RPC URL for Solana mainnet (e.g.,https://api.mainnet-beta.solana.com).rpc_url_testnet: The RPC URL for Solana testnet (optional).rpc_url_devnet: The RPC URL for Solana devnet (optional).
mainnet_vote_account&mainnet_identity_account: Your mainnet validator's vote and identity account public keys.testnet_vote_account&testnet_identity_account: Your testnet validator's accounts (optional).devnet_vote_account&devnet_identity_account: Your devnet validator's accounts (optional).
Note: The naming convention determines which RPC URL is used (e.g.,
mainnet_*accounts userpc_url_mainnet).
You have two options to run the exporter: direct build or Docker container.
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Build the exporter:
cargo build --release
-
Run the exporter:
./target/release/solana-validator-exporter --config-file config.yaml
-
Build the Docker image:
docker build -t solana-validator-exporter -f docker/Dockerfile . -
Run the container:
docker run -d \ --name solana-validator-exporter \ -p 9090:9090 \ -v $(pwd)/config.yaml:/home/exporter/config.yaml \ solana-validator-exporter --config-file /home/exporter/config.yaml
After running either method, you can verify the exporter is working by accessing the metrics endpoint:
curl http://localhost:9090/metricsThe exporter will expose metrics on the port specified in your configuration file (e.g., http://localhost:9090/metrics).
All metrics now include the following labels for easy filtering and identification:
network: The Solana network (mainnet, testnet, or devnet)vote_account: The validator's vote account public key
Example metric with labels:
solana_slot{network="mainnet",vote_account="YourVoteAccount..."} 123456789
solana_slot{network="testnet",vote_account="YourTestnetVoteAccount..."} 987654321
This allows you to create separate Grafana dashboards or alerts for different networks and validators.