How to Monitor a Signer
Last updated
Was this helpful?
Last updated
Was this helpful?
We will use to observe and monitor both the Signer and its corresponding Stacks node.
Grafana's application observability docs have a . We will use:
Grafana Cloud to collect metrics and visualize them.
Grafana Alloy, on the Signer host, to push the metrics.
Before we begin, create a account (they offer a free tier that you can use).
Once done, access your dashboard and:
Click on "Connections", then
"Add new connection", and
select "Hosted Prometheus metrics".
Now select "Via Grafana Alloy", then
On step 2, select "Run Grafana Alloy" to generate an API token.
Note the token GCLOUD_RW_API_KEY
and the parameters GCLOUD_HOSTED_METRICS_URL
and GCLOUD_HOSTED_METRICS_ID
, we will use them later.
Ensure both your Signer configuration and your node configuration include the following lines:
The pre-compiled binaries already include the monitoring feature. However, if you are compiling the application binaries yourself, remember to enable the Cargo feature monitoring_prom
while building them, for example:
Once both binaries are running with the updated configuration, you can peek at the metrics being exposed:
Also, you'll have a /info
endpoint on the same port:
On Debian-based distributions:
GCLOUD_HOSTED_METRICS_URL
GCLOUD_HOSTED_METRICS_ID
GCLOUD_RW_API_KEY
Metrics from your Signer and node will now start being pushed to Grafana Cloud.
You can now start building a dashboard to visualize the metrics.
Log-in to Grafana Cloud and create a new Dashboard.
Pick the Prometheus instance you created before as the data source.
Create a new panel and pick stacks_signer_current_reward_cycle
from the metrics.
You should now be able to see Stacks' current reward cycle, as measured by the Signer, into the dashboard.
This will expose metrics on port 9100
of localhost
.
We can now configure alloy
to push them to Grafana. Edit your /etc/alloy/config.alloy
file and add the following:
Now reload alloy
and check its status:
Follow these instructions to install .
Edit the file /etc/alloy/config.alloy
as follows, by taking care of replacing the placeholders related to the prometheus
endpoint with the parameters obtained when creating a :
Grafana comes with powerful data visualization tools. You can read about how to query and transform data , while here you will find examples on how to build .
will kick-start your dashboard.
.
Since we are here, we can also monitor the host itself. Debian-based distributions make it very easy for us by using .
node_exporter
provides a lot of metrics. Poke at them through the Grafana Explorer or use one of the many prepared dashboard (e.g., ) to see comprehensive information. Once you have a dashboard ready, you can also use it to configure a few alerts (e.g., on disk space, etc).