Grafana dashboard to display stats from Tor node stored in prometheus DB
Dashboard view


My git repo Guide is based on this guide on

Getting started

NOTICE: Prometheus exporter is supported only by tor version on time of writing (Oct 2021)

  1. Enable prometheus exporter on tor process
    “It’s important to understand that exposing tor metrics publicly is dangerous to the Tor network users. Please take extra precaution and care when opening this port. Set a very strict access policy with MetricsPortPolicy and consider using your operating systems firewall features for defence in depth.”
    Add or comment following two tines to torrc file
     ## Prometheus exporter
     MetricsPort x.x.x.x:9035 prometheus
     MetricsPortPolicy accept y.y.y.y

    x.x.x.x is IP address where Tor process will listen for connection from prometheus.
    DO NOT USE PUBLIC IP THERE. Use if TOR and prometheus are running at same host
    y.y.y.y is IP address from where TOR will accept connections. Keep it as restrictive as possible. Use if TOR and prometheus are running at same host

  2. Restart TOR process
  3. Configure job for prometheus to scrap data from tor Add following to prometheus.yml configuration file
     scrape_configs:  # this line should be already in config
         - job_name: tor-exit
             metrics_path: /metrics
             scheme: http  # https is not yet supported by tor
             - targets:
                 - x.x.x.x:9035
  4. Restart prometheus process
  5. Check prometheus console /targets that prometheus can scrap data from TOR
  6. Download tor_stats.json from git repo
  7. Go to your grafana and import new dashboard tor_stats.json. Point it to prometheus datasource