Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions Docker_Usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Docker Compose Setup Instructions for Collecting Data From `lnd` _AND_ `lndmon`

# Table of Contents
1. [Setup](#setup)
1. [Requirements](#requirements)
2. [Lnd](#lnd)
3. [Lndmon](#basic-lndmon-and-docker-compose-setup)
2. [Usage](#usage)
1. [Option 1: Nginx Proxy Usage](#option-1-nginx-proxy-usage-requires-domain-name)
2. [Option 2: Local Usage](#option-2-local-usage)
3. [Customizing Grafana Metrics](#customizing-grafana-metrics)

## Setup

### Requirements
* docker >= 18.09.6
* docker-compose >= 1.24

### Lnd

- You need to have an `lnd` node built with the `monitoring` tag up and running
with ports exposed and reachable.
- Run lnd with
* `prometheus.enable=true`
* `prometheus.listen=<IP>:8989`
* `rpclisten=<IP>`
* `tlsextraip=<IP>`
- Make sure you have the node's reachable IP defined in the cert.
- You may need to delete the existing `tls.cert` and `tls.key` in your lnd
data directory and restart lnd to regenerate the cert.
- Start `lnd` *before* `lndmon`.


Note: See README.md for some additional consideration about the options that
are set above.


### Basic `lndmon` and Docker Compose Setup

- Clone this repo
```
git clone https://github.com/lightninglabs/lndmon
cd lndmon/
```
- In the `.env` file in this repo
* Fill in the `TLS_CERT_PATH` and `MACAROON_PATH` variables relative to the
host filesystem to allow `lndmon` to connect to your `lnd` node.
- By default, `.lnd` lives in your home directory.
* Fill in the `LND_HOST` variable to match your lnd node's IP and port.
* Ensure the other lnd variables are also up-to-date.
* If you wish to run `lndmon` connecting to an `lnd` node on testnet or simnet:
- modify the `LND_NETWORK` variable to match your desired network.
- make sure the `MACAROON_PATH` matches the desired network as well.
- Edit `prometheus.yml` `lnd` `targets` section to match your node's IP.



## Usage
### Option 1: Nginx Proxy Usage (requires domain name)
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:
1. In the `lndmon` repository, edit the `.env` file and fill in the email, FQDN, and (optionally) timezone fields.
2. Ensure ports 80 and 443 on your machine are exposed to the internet.
3. (Optional) Basic auth setup for your Prometheus dashboard:
- Install `apache2-utils` package.
- 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.
4. If you want to use your own TLS certs:
- Uncomment the lines beginning with `SSL_` in `.env` and fill in the paths to your cert files.
- Uncomment the lines beginning with `- SSL_` in `docker-compose.nginx.yml`.
5. Start everything up
- `docker-compose -f docker-compose.yml -f docker-compose.nginx.yml up`
- Run this command within the `lndmon` repository 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.
6. Grafana is located at `https://<YOUR_DOMAIN>/grafana/`
7. Prometheus's expression browser is located at `https://<YOUR_DOMAIN>/prometheus/graph`.

### Option 2: Local Usage
1. Start everything up
- `docker-compose up`
* Run this command within the `lndmon` repository 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_HOST` in `.env` and the lnd target's IP in `prometheus.yml`.
2. 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).
3. 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`.


### Customizing Grafana Metrics
`lndmon`'s Grafana instance comes with a set of basic dashboards. Add additional dashboards by clicking the `+' sign on the left.
88 changes: 0 additions & 88 deletions INSTALL.md

This file was deleted.

1 change: 1 addition & 0 deletions MD_drawing_source/ARCHITECTURE.mono
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"root":{"i":"02-AAJXrZ6Xp1kj6Cr32Kv6TzaQ6Ce","v":-2005128647,"ss":[{"type":"T","i":"02-AASJvZ6UFa38vz4aH93SajBWm09","v":-42529672,"b":"62|11|24|3","t":"LND","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S3","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}},{"type":"T","i":"02-AAvB_Z6AQhiIOQ4dAoOmZ8kpOZp","v":304206202,"b":"-8|30|23|6","t":"LNDmon\n(aggregate, cache)","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S3","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}},{"type":"T","i":"02-AAHdEa6hOA5oeR9n5p8PYKAPir7","v":-1360757306,"b":"62|30|24|6","t":"Prometheus\n(time series DB)","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S3","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}},{"type":"T","i":"02-AAchJa6SMyzwi8a-ReJ9tbKCaWi","v":15041816,"b":"62|45|24|6","t":"Grafana\n(dashboard generation)","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S3","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}},{"type":"T","i":"02-AAiCMa6ggX0AICg6hEI0CyN_7nH","v":1859734430,"b":"62|60|24|6","t":"Firefox\n(dashboard display)","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S3","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}},{"type":"L","i":"02-AAdtga6Fs-BmFjGqzzmnw6x-jbI","v":1570681063,"ps":"V|73|59","pe":"V|73|51","jps":["73|59","73|51"],"e":{"su":"S1","ase":true,"asu":"A13","aeu":"A13","du":"1|0|0"},"em":true},{"type":"L","i":"02-AAQ88a6QyJU7PQJzAuQsk9-hARP","v":584401933,"ps":"V|73|44","pe":"V|73|36","jps":["73|44","73|36"],"e":{"su":"S1","ase":true,"asu":"A13","aeu":"A13","du":"1|0|0"},"em":true},{"type":"L","i":"02-AAlZDb6vQ7-uQm1dnIpMirnlJST","v":-1650624233,"ps":"V|73|29","pe":"V|73|14","jps":["73|29","73|14"],"e":{"su":"S1","ase":true,"asu":"A13","aeu":"A13","du":"1|0|0"},"em":true},{"type":"L","i":"02-AATvFb6p-vTC-Mlt5nTB9WDG3ob","v":-930450856,"ps":"H|3|29","pe":"V|61|12","jps":["3|29","3|12","61|12"],"e":{"su":"S1","ase":true,"asu":"A13","aeu":"A13","du":"1|0|0"},"em":true},{"type":"L","i":"02-AAyOVb6zv72tsMXJ52G41JIMA_8","v":-1069086399,"ps":"H|61|32","pe":"V|16|32","jps":["61|32","16|32"],"e":{"su":"S1","ase":true,"asu":"A13","aeu":"A13","du":"1|0|0"},"em":true},{"type":"T","i":"02-AAtueb6UGTzLmzk3eiuK8R1uBql","v":334441596,"b":"37|11|27|2","t":"gRPC Server (TCP/10009)","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":0,"tva":0}},{"type":"T","i":"02-AAFujb6dbLSLDe8t0puwfM92iM2","v":804253644,"b":"61|51|11|4","t":"http\nServer (TCP/3000)","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":2,"tva":0}},{"type":"T","i":"02-AA7Vub6IducU9BuHFR9j60Ntyy1","v":-1652915761,"b":"76|14|14|6","t":"Prometheus Exporter (TCP/8989)","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":0,"tva":0}},{"type":"T","i":"02-AANFBc6CGs4b8loPdq9tZalljDw","v":-1409851074,"b":"76|28|21|2","t":"Prometheus\nScraper","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":0,"tva":0}},{"type":"T","i":"02-AAj-Yc6Rwi-1f3UDco-D3tXxeQS","v":573473110,"b":"42|33|19|2","t":"Prometheus\nScraper","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":2,"tva":0}},{"type":"T","i":"02-AAaGgc6UeMjo_M-0rQr1ZsBBMip","v":-2134692173,"b":"16|29|30|3","t":"Prometheus\nExporter\n(TCP/9092)","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":0,"tva":0}},{"type":"T","i":"02-AAeCmc6IHdH8hmzG5FX_vyZZFBP","v":1157215555,"b":"-6|28|8|3","t":"gRPC\nClient","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":2,"tva":0}},{"type":"T","i":"02-AAafdd67tzgW1wFOzKq55TYPMSY","v":-1173837372,"b":"66|58|6|3","t":"http\nClient","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":2,"tva":0}},{"type":"T","i":"02-AAVr8i6qNHVwDTTlyx_H9Xx9LHn","v":-1497014465,"b":"66|43|6|3","t":"http\nClient","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":2,"tva":0}},{"type":"T","i":"02-AAVr8i62FfyJU2vUzRNBeAqI1nH","v":-1883913703,"b":"61|36|11|4","t":"http\nServer (TCP/9090)","e":{"be":{"fe":false,"fu":"F1","be":false,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":2,"tva":0}},{"type":"T","i":"02-AAmWlE-uOsv5DwqLSokIgJlMObi","v":-531157672,"b":"61|20|26|3","t":"gRPC performance stats","e":{"be":{"fe":false,"fu":"F2","be":true,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}},{"type":"T","i":"02-AAhphF-QKWY63znhzwPl0Cyv4Jt","v":1274825508,"b":"30|31|18|3","t":"gRPC call data","e":{"be":{"fe":true,"fu":"F1","be":true,"bu":"S1","du":"1|0|0","rc":"NNNN"},"tha":1,"tva":1}}]},"extra":{"name":"Undefined","offset":"644|0"},"version":2,"modified_timestamp_millis":1763065567589}
Loading
Loading