This repository contains a template for simple monitoring stack.
Features:
-
Display tBTC node metrics
-
Alerting (via Discord)
The template consists of:
-
Docker Compose manifest with Grafana and Traefik
-
Traefik is used as a reverse proxy and provides SSL/TLS certificates from Let’s Encrypt. SSL/TLS certificate requires a domain name.
-
-
Configuration for Grafana
-
Pre-configured data source with Threshold’s Prometheus (https://monitoring.threshold.network/prometheus/)
-
Policy and Contact point with Discord
-
Dashboard
-
The monitoring can be run on your local machine or on a server. The only requirement is to have Docker and Docker Compose installed. If you want to use SSL/TLS certificates from Let’s Encrypt, you need to have a domain name.
-
Fork this repository.
-
Copy
.env.template
into.env
file. Fill in the variables. That file is used by Docker Compose. -
(optional) Modify
docker-compose.yaml
file. Uncomment HTTPS parts if you have a domain name. -
Modify
config/grafana/provisioning/alerting/contactpoints.yaml
file. Replace<your_discord_webhook_url>
with your Discord webhook URL. -
Run
docker-compose up -d
to start the stack. -
Open Grafana in your browser (http://grafana.127.0.0.1.nip.io by default).
-
Login with
admin
/admin
credentials. Change the password.
-
Open
Dashboards
and select New → Import. -
Paste the content of
dashboard.json
file into theImport via panel json
field. -
Click
Load
and thenImport
(select proper pre-defined data source). -
Go to
Dashboards
and selecttBTC Node
dashboard. -
Go to dashboard settings and replace variable
chain_address
with your node’s address.Currently, the dashboard contains 2 addresses only for demo - these are tBTC bootstrap nodes. They don’t expose all metrics, thus the dashboard won’t work fully with them.
💡
|
It’s recommended to create a separate dashboard for each node. |
Alerts related to the state of a node. Each node should has its own alerting rule.
-
Open
Dashboards
and click Edit onStatus
panel. -
Go to
Alert
tab and clickCreate alert rule from this panel
. -
Set the name. Recommended schema:
Status <chain_address>
. -
In the 3rd point create a folder and an evaluation group. Recommended name:
tBTC
for both. Use1m
for evaluation interval. Set1m
forPending period
. Take a look at the screenshots below. -
Complete the 4th point as you wish. These information will be placed in the alert.
-
The 5th point is not needed.
-
Click
Save rule and exit
.