Monitoring system — PoC
Introduction
This article presents a proof of concept of the monitoring solution suggested in the article Monitoring — main reference. It aims to serve as an example for developers implementing a Prometheus-based monitoring system for their full nodes.
This article is intended to be used in conjunction with two other articles, namely:
Overview
This proof of concept comprises the following components:
- Hathor full node
- Node exporter
- Prometheus
- Grafana
- Alertmanager
- Docker compose
Docker compose is used to orchestrate containers for the other five components. Thus, this proof of concept consists of a set of configuration files organized in the directory structure as follows:
poc/
├── prometheus/
│ ├── prometheus.yml
│ └── alerting_rules.yml
├── grafana/
│ ├── dashboards/
│ │ ├── hathor-core/
│ │ │ └── hathor_fullnodes.json
│ │ └── dashboards.yml
│ └── datasources/
│ └── prometheus.yml
├── alertmanager/
│ ├── config/
│ │ └── template_sns.tmpl
│ └── alertmanager.yml
└── docker-compose.yml
The following sections discuss the configuration files for Docker compose, Prometheus, Grafana and Alertmanager. Hathor full node and Node exporter do not require separate configuration files, as all their execution parameters are already configured within Docker compose. Now, to download the source code of this proof of concept, that is, the configuration files presented throughout this article, use hathor-monitoring-system-poc.zip.
<Placeholders>
: in the code samples of this article, as in all Hathor docs, <placeholders>
are always wrapped by angle brackets < >
. You shall interpret or replace a <placeholder>
with a value according to the context. Whenever replacing a <placeholder>
like this one with a value, do not wrap the value with quotes. Quotes, when necessary, will be indicated, wrapping the "<placeholder>"
like this one.
Note that many configurations depend on the deployment environment. In this proof of concept, the case of AWS is considered.
Docker compose
In the root of the poc
directory, the docker-compose.yml
file is located. This file is the only configuration file required to orchestrate containers for all five components of the proof of concept. For example:
poc/docker-compose.yml
Prometheus
The prometheus
directory contains the two configuration files required for running Prometheus:
prometheus.yml
alerting_rules.yml
prometheus.yml
specifies the overall configuration for the execution of Prometheus. For example:
poc/prometheus/prometheus.yml
alerting_rules.yml
specifies the alarms and alerts to be created in Prometheus. For example:
poc/prometheus/alerting_rules.yml
Grafana
The grafana
directory contains the three configuration files required for running Grafana:
datasources/prometheus.yml
dashboards/dashboards.yml
dashboards/hathor-core/hathor_fullnodes.json
datasources/prometheus.yml
specifies how Grafana connects to Prometheus as a data source. For example:
poc/grafana/datasources/prometheus.yml
Note that one can only use prometheus
in the http://prometheus:9090
URL when using Docker compose. Otherwise, one needs to use the network address of the Prometheus server.
dashboards/dashboards.yml
specifies the dashboard configuration in Grafana. For example:
poc/grafana/dashboards/dashboards.yml
dashboards/hathor-core/hathor_fullnodes.json
is the source code for the the dashboard created by Hathor Labs to facilitate day-to-day operation of full nodes. To get this dashboard, refer to Hathor full node public dashboard.
Alertmanager
The alertmanager
directory contains two configuration files for running Alertmanager.
alertmanager.yml
config/template_sns.tmpl
alertmanager.yml
is required and specifies the overall configuration for the execution of Alertmanager. For example:
poc/alertmanager/alertmanager.yml
Note that beyond configuring this configuration file, it is also necessary to configure each notification receiver. In this proof of concept, the only receiver is AWS SNS.
config/template_sns.tmpl
is optional and specifies a template for notification messages dispatched by Alertmanager to its defined receivers. For example:
poc/alertmanager/config/template_sns.tmpl
What's next?
-
Monitoring — main reference: to consult about monitoring while operating full nodes.
-
Metrics: reference material regarding metrics tracked by Hathor core.
-
Install a monitoring system: step-by-step to install a Prometheus-based monitoring system.
-
Full node pathway: to know how to operate a full node.