Prometheus and Grafana monitoring stack for BitAxe Bitcoin miners. Collects metrics from the BitAxe API and provides a pre-configured dashboard for real-time monitoring and historical analysis.
- 55+ metrics including hashrate, temperature, power, shares, and network stats
- 3-year data retention by default
- Pre-configured Grafana dashboard with organized panels
- Auto-discovery of Prometheus datasource
- Hot-reload targets without restarting services
-
Clone the repository:
git clone https://github.com/yourusername/bitaxe-monitor.git cd bitaxe-monitor -
Configure your environment:
cp .env.example .env cp targets.yml.example targets.yml
-
Edit
targets.ymland set your BitAxe IP address:- targets: - http://YOUR_BITAXE_IP/api/system/info labels: name: bitaxe-1
-
Start the stack:
docker compose up -d
-
Open Grafana at
http://localhost:3000(login:admin/admin)
- Prometheus targets: If Prometheus appears to miss targets, inspect active targets with:
curl -s http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | {job: .scrapePool, health: .health, lastError: .lastError}'-
Prometheus UI: Open
http://localhost:9090/targetsto view scrape status and service discovery details. -
Check
targets.ymland config: Ensureprometheus.ymlreferencestargets.ymland thattargets.ymlcontains correct BitAxe URLs (they should include/api/system/info). View the file locally with:
cat targets.yml- JSON Exporter: Confirm the JSON exporter is serving metrics and the endpoints are reachable:
curl -s http://localhost:7979/metrics | head -n 40- Docker status & logs: See which services are running and inspect logs:
docker compose ps
docker compose logs -f
# After confirming service names, follow a single service (example):
docker compose logs -f prometheus- Required tools: The
jqutility is used above for pretty output. Install withbrew install jqif missing.
| Service | Port | Description |
|---|---|---|
| Grafana | 3000 | Dashboards and visualization |
| Prometheus | 9090 | Metrics storage and querying |
| JSON Exporter | 7979 | Converts BitAxe JSON API to Prometheus metrics |
All configuration is done through two files:
# Ports
PROMETHEUS_PORT=9090
JSON_EXPORTER_PORT=7979
GRAFANA_PORT=3000
# Grafana
GRAFANA_PASSWORD=admin
# Data retention (e.g., 15d, 6m, 3y)
PROMETHEUS_RETENTION=3yAdd your miners here. Prometheus auto-reloads this file every 30 seconds.
# Single miner
- targets:
- http://192.168.1.100/api/system/info
labels:
name: bitaxe-1
# Multiple miners with labels
- targets:
- http://192.168.1.101/api/system/info
- http://192.168.1.102/api/system/info
labels:
location: office| Category | Metrics |
|---|---|
| Hashrate | Current, 1m/10m/1h averages, expected, error % |
| Temperature | ASIC, voltage regulator, target |
| Power | Watts, voltage, current, efficiency |
| Mining | Shares accepted/rejected, best difficulty, block height |
| Cooling | Fan RPM, fan %, auto-fan status |
| Network | WiFi RSSI, pool latency, pool status |
| System | Uptime, free heap, frequency |
Persistent data is stored in:
./data/prometheus/- Time series data./data/grafana/- Grafana configuration and dashboards
MIT
