The namada-exporter is a tool designed to integrate with Namada network, enabling efficient monitoring for Prometheus.
Pre-built Grafana dashboard for the namada-exporter are available and detailed in a section below.
For an example of the metrics exposed by the namada-exporter, refer to the metrics.example file.
Run the following command to install the necessary packages.
apt-get install -y git curl clang libssl-dev protobuf-compiler pkg-configThe namada-exporter is built using Rust. Follow these steps to install Rust and Cargo.
Install rustup.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shRestart your current shell to reload the PATH environment variable, or source the environment file.
. "$HOME/.cargo/env" Verify the installation.
cargo --version
rustc --versionClone the repository to your local machine.
# Clone this repository, copy the URL from the Code button above.
git clone <copied-url>
cd <repository-name>Build the project using Cargo. The binaries will be compiled and available at target/release/namada-exporter.
cargo build --releaseCreate a configuration file by copying the example file, then update config.toml with your specific settings.
cp config.example.toml config.tomlTo display metrics directly in your browser (instead of triggering a file download), add the following line to your config.toml:
metrics_content_type = "text/plain; charset=utf-8"By default, the exporter uses the application/openmetrics-text; version=1.0.0; charset=utf-8 content type, as defined in the prometheus OpenMetrics specification.
This may cause your browser to download the metrics output as a file instead of displaying it.
You can set up a health check to automatically send a "heartbeat" signal to monitoring services like Uptime Kuma or healthchecks.io and simular.
To enable this, add a healthcheck section to your configuration file:
[healthcheck]
# The URL provided by your monitoring service to receive pings
ping_url = "https://hc-ping.com/your-unique-id"
# How often to send a ping (e.g., every 10 seconds)
ping_rate = "10s"
# How long to wait for a response before timing out
timeout = "5s"Notes:
- Replace
"https://hc-ping.com/your-unique-id"with the actual URL from your monitoring service. - Adjust
ping_rateandtimeoutas needed for your setup. default is 10 seconds.
Start the namada-exporter using the configuration file.
./namada-exporter start --config config.tomlYou can verify that the namada-exporter is running correctly by using the following command or by accessing the URL in your browser. If everything is set up correctly, it will return OK.
curl http://127.0.0.1:3001/Once the service is running, you can query the metrics by using the following command.
curl http://127.0.0.1:3001/metricsThis will return all the metrics, formatted similarly to the metrics.example file.
If you access the /metrics endpoint via a browser, it will download a file named metrics (without an extension). This behavior is in accordance with the Grafana specifications outlined in the OpenMetrics standard.
Here is an example of a Grafana dashboard showcasing the essential metrics and data for effectively managing a validator node. This dashboard serves as a great starting point and can be customized to fit your specific requirements.
To import the dashboard into your Grafana instance, follow these steps:
- Copy the contents of the namada-validator-dashboard.json file from this repository.
- Navigate to your Grafana dashboard and click the
+button on the left sidebar. - Select
Import. - Either upload the
namada-validator-dashboard.jsonfile or paste its contents into the text area provided. - Click
Loadand follow the instructions to save the dashboard.
Alternatively, access the dashboard directly on Grafana's website: 20550-namada-validators | Grafana Labs.
