# Overview
Docker (opens new window) and Docker Compose (opens new window) will allow you to run the required monitoring applications with a few commands. These instructions will run the following:
- Grafana (opens new window) on port
3000
: An open source interactive analytics dashboard. - Prometheus (opens new window) on port
9090
: An open source metric collector. - Node Exporter (opens new window) on port
9100
: An open source hardware metric exporter.
# Preparing your environment
- You will need to install docker and docker-compose.
- The following instructions assume Ubuntu 20.04 on an x86-64 CPU.
# Install Docker
- Remove older installations:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
- Update the apt package index and install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
2
3
4
5
6
7
- Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- Setup the docker stable repository:
$ echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
2
3
- Install docker:
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
2
- Test the installation:
$ sudo docker run hello-world
# Install Docker Compose
- Download the current stable release of Docker Compose:
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- Apply executable permissions to the binary:
$ sudo chmod +x /usr/local/bin/docker-compose
- Test the installation:
$ docker-compose --version
# Setup and Configuration
- Clone the node_tooling repo (opens new window) and decend into the monitoring folder:
$ git clone https://github.com/LavenderFive/node_tooling.git
$ cd ./node_tooling/monitoring
2
- In the prometheus folder, modify cosmos.yaml, replace
NODE_IP
with the IP of your node. (If your node is on the docker host machine, use172.17.0.1
)
$ nano ./prometheus/cosmos.yaml
- Replace the default prometheus config with the modified cosmos.yaml
$ mv ./prometheus/prometheus.yml ./prometheus/prometheus.yml.orig
$ cp ./prometheus/cosmos.yaml ./prometheus/prometheus.yml
2
# Start the Containers
- Start the contrainers deploying the monitoring stack (Grafana + Prometheus + Node Exporter):
$ docker-compose --profile monitor up -d
- Login to Grafana at
http://your-ip:3000
with usernameadmin
and passwordadmin
The containers will restart automatically after rebooting unless they are stopped manually.
# Using the Cosmos SDK Grafana Dashboard
The dashboard for Cosmos SDK nodes is pre-installed, to use it:
- Enable Tendermint metrics in your game node
sed -i 's/prometheus = false/prometheus = true/g' <YOUR-NODE-HOMEDIR>/config/config.toml
After restarting your node, you should be able to access the tendermint metrics(default port is 26660): http://localhost:26660 (opens new window)
- (If you did not replace
NODE_IP
with the IP of your node in the prometheus config), do so now. (If your node is on the docker host machine, use172.17.0.1
)
$ nano ./prometheus/prometheus.yml
$ docker-compose down
$ docker-compose --profile monitor up -d
2
3
- Login to grafana and open the Cosmos Dashboard from the Manage Dashboards (opens new window) page.
- Set the chain-id to desired chain
# Application Ports
The docker images expose the following ports:
3000
Grafana. Your main dashboard. Default login is admin\admin.9090
Prometheus. Access to this port should be restricted.9100
Node Exporter. Access to this port should be restricted.- Your game node metrics on port
26660
should also be restricted.
If you followed the basic security guide, these ports are already restricted. You will need to allow the grafana port:
sudo ufw allow 3000
You can also allow access from a specific IP if desired:
sudo ufw allow from 123.123.123.123 to any port 3000
# Stop the Containers
- From the
node_tooling/monitoring
directory:
$ docker-compose down
← Cosmovisor State Sync →