Monitoring Cosmos Validators with Prometheus and Grafana
While exploring optimal ways to monitor our Cosmos-Tendermint nodes, we settled on a combination of several tools:
- The built-in Prometheus endpoint for basic monitoring.
- cosmos-validators-exporter by QuokkaStake for validator-specific metrics.
- Standard Node Exporter for system-level metrics.
All network communication is secured via basic authentication and SSL encryption. Here are some of the steps we use to set up monitoring for our Cosmos validator infrastructure. This guide assumes that Prometheus, Grafana, Node Exporter are already installed and running.
TLDR
You can browse and download the necessary scripts and related resources directly from the our repository Cosmos Monitoring Repo.
Step 1. Enable Prometheus on the node
We recommend binding Prometheus to localhost and exposing it securely via nginx reverse proxy. If needed, you may allow direct external access instead. Set prometheus = true and prometheus_listen_addr = "127.0.0.1:26660" in config.toml.
Step 2. Install and configure Cosmos Validators Exporter
This exporter is helpful when running multiple nodes (across different networks) on the same host — a common case for Cosmos testnets.
It requires the API service to be enabled on the node. Set enable = true and address = "tcp://127.0.0.1:1317 in API subsection of app.toml
For installation and configuration, see https://github.com/QuokkaStake/cosmos-validators-exporter.
In our setup, we set listen-address = "127.0.0.1:9560" in cosmos-validators-exporter/config.toml.
Step 3. Configuring Prometheus
Here comes a bit of Prometheus magic — we have three separate metric sources, and cosmos-validators-exporter can expose metrics for multiple networks from a single server.
To keep everything clean and linked, we use file-based discovery and a custom host label (stripping the port), which unifies metrics from the same server across jobs.
Example part of prometheus.yml
This prometheus.yml example uses file-based targets for flexibility. We generate a host label by stripping port from __address__, allowing unified host-level correlation between exporters.
The files targets/*.json define scraping targets and instance labels. These are dynamically loaded without Prometheus restart.
For example, files such as /etc/prometheus/targets/tendermint-testnet.json /etc/prometheus/targets/cosmos-testnet.json targets/node_exporter.json
/etc/prometheus/targets/node_exporter.json
Step 4. Authentication and SSL
Here in Prometheus config we enable HTTPS responses, set up basic authentication (login + password), and enforce SSL certificate validation.
To make it all work, we generate our own root Certificate Authority (CA) — designed to last a very long time. This gives us full control over issuing and verifying certs within our infrastructure, without relying on external CAs.
Generate a self-signed CA and TLS certs for each IP:
Don't forget to copy .crt and .key files to the /etc/node_exporter folder in approptiate server.
Step 6. Secure reverse proxy with nginx
To securely expose local metrics endpoints via HTTPS and protect them with basic authentication, you’ll need nginx.
Install nginx and required utilities
Create basic auth credentials. This user/password pair should match the basic_auth section in your Prometheus scrape config. Replace user with your preferred username. You’ll be prompted to enter a password.
Enable and start nginx.
(Optional) Allow HTTPS traffic in firewall if you’re using ufw:
You can use the following nginx examples to securely expose metrics
/etc/nginx/site-available/cosmos-exporter
/etc/nginx/site-available/some-deamon-prometheus
Validate and reload nginx:
Now export grafa-dashboard.json.