This repo contains the monitoring setup for razor-go staker along with the host in which it is running.
We are using
- Victoria Metrics: To scrap prometheus metrics form exporters.
- Grafana: For dashboard on metrics
- loki: Aggregate logs and provide to grafana.
- promtail:An agent which ships the contents of local logs
- node-exporter: node-exporter provide host based metrics to Victoria scraper
- caAdvisor: caAdvisor provide containers based metrics to Victoria scraper
- Alertmanager: Via Alertmanager we can configure alert for our staker and host.
- You must have Docker and Docker Compose installed.
- If you are running staker via docker and running on same host, then your staker should up and running with
razor_network
can refer here - You must expose razor-go metrics, can refer here
NOTE:
razor_network
is a docker based bridge network through which staker and monitoring stack communicate securely without exposing anything publicly.
-
If your staker is running via binary, then
- In
./configs/prometheus.yml
, replace"razor-go:2112"
with"<private/public address of host>:2112"
- In
-
For alerting you can add webhook in
./configs/alertmanager.yml
, replacehttp://127.0.0.1:5001/
with your webhook URL. This will send you an alert in every 5min if metrics stops. -
If you are running multiple stakers and want to monitor via single grafana dashboard
- You need to update
./config/prometheus.yml
, add new target block wherejob_name: "razor-go"
- targets: ["<second-host-address>:2112"] labels: staker: "<staker-name>"
- Restart vmagent service
docker-compose restart vmagent
- You need to update
-
You can spin all agents at once via
docker-compose up -d
Can check the status of each service via
docker-compose ps
-
You can open grafana at
<private/public address of host>:3000
, and get- Can checkout
Razor
dashboard to monitor your staker. - Insight of host metrics at
Node Exporter Full
dashboard. - Containers Insight at
Docker and OS metrics ( cadvisor, node_exporter )
dashboard. - Can monitor alerts at
Alertmanager
dashboard.
- Can checkout
NOTE: Configure firewall for port
3000
on your host to access grafana.
-
In
docker-compose.yml
uncomment ports foralertmanager
andvmalert
. -
Configure firewall to allow access to ports
8880
and9093
. -
Check you get alerts on vmalert via
http://<host_address>:8880/vmalert/alerts
. vmalert is configured to scrap in every 2min. -
If you see alert in vmalert then look into alertmanager
http://<host_address>:9093/#/alerts?
, if you see alerts in there but you didn't get one then probably you need to check your weebhook.