snarkos-node-metrics
The snarkos-node-metrics crate provides access to metrics for the snarkos node.
Instructions
Quick Start
To start up Grafana and Prometheus, run the following command:
To check that the metrics are running, go to http://localhost:9000.
Lastly, go to http://localhost:3000/ to see the metrics dashboard.
The initial login is admin and the password is admin.
First-Time Setup
-
Start snarkOS with Metrics Enabled
- Launch snarkOS using the command line with the
--metricsflag to enable metrics tracking.
- Launch snarkOS using the command line with the
-
Navigate to Metrics Directory
- Change your current directory to
node/metricsusing the commandcd node/metrics.
- Change your current directory to
-
Deploy Prometheus and Grafana with Docker
- Execute
docker-compose up --detach. This command uses thedocker-compose.ymlfile to set up two containers: Prometheus and Grafana, eliminating the need for direct installation.
- Execute
-
Verify Metrics Accessibility
- Use the command
curl http://localhost:9000to check if the metrics are accessible at the specified URL.
- Use the command
-
Access Grafana Dashboard
- Open your web browser and navigate to
http://localhost:3000. This is the Grafana user interface.
- Open your web browser and navigate to
-
Grafana Login Process
- Log in using the default credentials: username
adminand passwordadmin. On first login, you'll be prompted to change the password, but you can choose to skip this step.
- Log in using the default credentials: username
-
Configure Prometheus Data Source
- In Grafana, navigate to
Datasources. - Select
Prometheusas the data source. - Enter
http://prometheus:9090as the server URL. - Confirm the setup by clicking
Save and Test. You should see a message confirming successful connection to the Prometheus API.
- In Grafana, navigate to
-
Import snarkOS Dashboard
- Return to the Grafana home page by clicking
Homein the top breadcrumb navigation. - Click on the arrow next to the
+icon in the top right corner. - Select
Import dashboard. - Drag and drop the
node/metrics/snarkOS-grafana.jsonfile into the top panel of the import interface. - From the dropdown box, choose the Prometheus data source you previously set up.
- Finalize the process by clicking
Import.
- Return to the Grafana home page by clicking
Following these steps will successfully set up and configure a monitoring environment for your snarkOS nodes using Docker, Prometheus, and Grafana.