This project monitors Solana validator metrics using Docker and Docker Compose. It also integrates with Prometheus and Grafana for visualization.
- Docker: Container management
- Docker Compose: Multi-container orchestration
- Git: To clone the repository
Set up Docker by adding the official Docker repository and installing the required packages.
Follow the official Docker installation guide for more details.
# Update packages and install dependencies
sudo apt-get update
sudo apt-get install ca-certificates curl
# Add Docker's official GPG key and set up the repository
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo curl -L https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Download the project source code:
git clone https://github.com/qskyhigh/solana-monitor-public
cd solana-monitor-public
Use Docker Compose to build the project and run the services in the background:
docker-compose build --no-cache
docker-compose up -d
To connect Prometheus and Loki with Grafana Cloud, you need to generate your own API tokens and update the relevant configuration files.
In the prometheus.yml
file, replace the username
and password
with your own Grafana Cloud Prometheus API credentials.
remote_write:
- url: https://prometheus-prod-13-prod-us-east-0.grafana.net/api/prom/push
basic_auth:
username: YOUR_USERNAME
password: YOUR_API_TOKEN
In the promtail.yml
file, replace the username
and token
with your own Grafana Cloud Loki credentials.
clients:
- url: https://YOUR_USERNAME:[email protected]/loki/api/v1/push
- Log in to your Grafana Cloud account.
- Go to the API Keys section under Settings.
- Generate API tokens for both Prometheus and Loki.
- Use the generated tokens to replace the placeholders in
prometheus.yml
andpromtail.yml
.
The dashboard can be imported from the docs/ directory to your Grafana instance
- Default is to utilize a label applied by the collector
host: solana-monitor-testnet
(you can change the global label inprometheus.yml
)
You can check the running Docker containers with:
docker ps
Once the containers are up, access Grafana to visualize Solana metrics. For more details on the dashboard configuration, refer to the provided Grafana screenshot:
To monitor system-level metrics such as CPU, memory, and disk usage, you can use the Node Exporter.
You can download and import the Node Exporter dashboard with ID 1860 from Grafana's dashboard library:
- Go to Grafana and navigate to Dashboards > Import.
- Enter the Dashboard ID:
1860
and click Load. - Select your Prometheus datasource and click Import.
This will provide a comprehensive overview of your system's performance using Node Exporter metrics.
If you found this project helpful, feel free to support by donating SOL to my wallet.
SOL Wallet Address: FNu9BCwCmgSmeCa56LCAErPBNeAdgnQJsBrrLgVbbMKt