- docker >= 18.09.6
- docker-compose >= 1.24
- You need to have an
lndnode built with themonitoringtag up and running with ports exposed and reachable. - Run lnd with
prometheus.enable=trueprometheus.listen=<IP>:8989rpclisten=<IP>tlsextraip=<IP>- Make sure you have the node's reachable IP defined in the cert.
- You may need to delete the existing
tls.certandtls.keyin your lnd data directory and restart lnd to regenerate the cert.
- Start
lndbeforelndmon.
Note: See README.md for some additional consideration about the options that are set above.
- Clone this repo
git clone https://github.com/lightninglabs/lndmon
cd lndmon/
- In the
.envfile in this repo- Fill in the
TLS_CERT_PATHandMACAROON_PATHvariables relative to the host filesystem to allowlndmonto connect to yourlndnode.- By default,
.lndlives in your home directory.
- By default,
- Fill in the
LND_HOSTvariable to match your lnd node's IP and port. - Ensure the other lnd variables are also up-to-date.
- If you wish to run
lndmonconnecting to anlndnode on testnet or simnet:- modify the
LND_NETWORKvariable to match your desired network. - make sure the
MACAROON_PATHmatches the desired network as well.
- modify the
- Fill in the
- Edit
prometheus.ymllndtargetssection to match your node's IP.
If you want to enable the built-in nginx proxy feature in order to access your Prometheus and Grafana dashboards remotely, these are the steps:
- In the
lndmonrepository, edit the.envfile and fill in the email, FQDN, and (optionally) timezone fields. - Ensure ports 80 and 443 on your machine are exposed to the internet.
- (Optional) Basic auth setup for your Prometheus dashboard:
- Install
apache2-utilspackage. - Run
htpasswd -c nginx/etc/.htpasswd <YOUR_USERNAME>and follow the prompts to enter and confirm your desired password. - In
lndmon/nginx/etc/service.conf, uncomment the lines indicated in the file to enable basic auth.
- Install
- If you want to use your own TLS certs:
- Uncomment the lines beginning with
SSL_in.envand fill in the paths to your cert files. - Uncomment the lines beginning with
- SSL_indocker-compose.nginx.yml.
- Uncomment the lines beginning with
- Start everything up
docker-compose -f docker-compose.yml -f docker-compose.nginx.yml up- Run this command within the
lndmonrepository directory - Unless you opted to use your own certs above, this will result in the automatic generation of TLS certificates through Let's Encrypt if they haven't been generated already, or their renewal if the current certs have expired. The certs will automatically renew when they expire.
- Run this command within the
- Grafana is located at
https://<YOUR_DOMAIN>/grafana/ - Prometheus's expression browser is located at
https://<YOUR_DOMAIN>/prometheus/graph.
- Start everything up
docker-compose up- Run this command within the
lndmonrepository directory - If you get the error "transport: Error while dialing dial tcp 172.17.0.1:10009: i/o timeout", your docker interface may not have the default IP. Make sure your docker interface's IP matches the IP for
LND_HOSTin.envand the lnd target's IP inprometheus.yml.
- Run this command within the
- Access Grafana dashboard:
- Get Grafana's IP:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' lndmon_grafana_1
- Grafana's dashboard is located at
http://<GRAFANA_IP>:3000/.- The default password for the admin user is also admin (you can change it after the first login).
- Get Grafana's IP:
- Access Prometheus expression browser:
- Get Prometheus's IP:
-
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' lndmon_prometheus_1 - Prometheus's expression browser is located at
http://<PROMETHEUS_IP>:9090/graph.
- Get Prometheus's IP:
-
lndmon's Grafana instance comes with a set of basic dashboards. Add additional dashboards by clicking the `+' sign on the left.