Skip to main content
MyTonCtrl pushes metrics to a Prometheus Pushgateway so Prometheus (and Grafana, if used) can scrape them without exposing the node directly.

Prerequisites

  • Docker and Docker Compose are installed on the host that runs Prometheus.
  • MyTonCtrl installed and running on the node that emits metrics.

Deploy Prometheus and Pushgateway

  1. In an empty directory, create docker-compose.yml:
services:
 pushgateway:
   image: prom/pushgateway:v1.4.0
   restart: unless-stopped
   ports:
     - "9091:9091"

 prometheus:
   image: prom/prometheus:v2.52.0
   restart: unless-stopped
   volumes:
     - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
   command:
     - "--config.file=/etc/prometheus/prometheus.yml"
   ports:
     - "9090:9090"
  1. Create prometheus.yml alongside it:
global:
 scrape_interval: 15s

scrape_configs:
 - job_name: "mytonctrl_pushgateway"
   static_configs:
     - targets: ["pushgateway:9091"]
  1. Start the stack and confirm the container status:
docker compose up -d
docker compose ps

Configure MyTonCtrl to push metrics

  1. Open the MyTonCtrl console:
mytonctrl
  1. Enable Prometheus mode:
MyTonCtrl> enable_mode prometheus
  1. Point MyTonCtrl to the Pushgateway (include a job name):
MyTonCtrl> set prometheus_url http://<PUSHGATEWAY_HOST>:9091/metrics/job/<JOB_NAME>
<PUSHGATEWAY_HOST> — host running the Pushgateway (use 127.0.0.1 when MyTonCtrl and Docker run on the same machine). <JOB_NAME> — unique label for this node, for example validator1.
Use unique job namesDo not reuse the same JOB_NAME across nodes when scraped by one Prometheus instance, or metrics collide.

Verify metrics

  • Pushgateway: open http://<PUSHGATEWAY_HOST>:9091 and confirm metrics appear under <JOB_NAME>.
  • Prometheus targets: open http://<PROMETHEUS_HOST>:9090/targets and check that mytonctrl_pushgateway shows UP.
  • Prometheus graph: query mytonctrl_synced or other MyTonCtrl metrics at http://<PROMETHEUS_HOST>:9090/graph.