Monitor .onion Service Uptime and Performance
Monitoring Tor hidden services requires a different approach than clearnet sites — you cannot use standard uptime monitors because they need Tor connectivity to reach .onion addresses. This guide covers building a Tor-aware monitoring stack with Prometheus, Grafana, and custom health check scripts that connect over Tor to verify your service is reachable.
Need this done for your project?
We implement, you ship. Async, documented, done in days.
Tor-Based Health Check Scripts
Create a health check script that connects to your .onion address via Tor and reports status. This script uses torsocks and curl to perform the actual check:
#!/bin/bash
# check_onion.sh — Health check for .onion services
ONION_URL="http://your56charaddress.onion"
TIMEOUT=60
LOG_FILE="/var/log/onion-health.log"
# Perform health check via Tor
START=$(date +%s%N)
HTTP_CODE=$(torsocks curl -s -o /dev/null -w "%{http_code}" \
--max-time $TIMEOUT "$ONION_URL" 2>/dev/null)
END=$(date +%s%N)
LATENCY=$(( (END - START) / 1000000 ))
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
if [ "$HTTP_CODE" = "200" ]; then
echo "$TIMESTAMP OK status=$HTTP_CODE latency=${LATENCY}ms" >> $LOG_FILE
else
echo "$TIMESTAMP FAIL status=$HTTP_CODE latency=${LATENCY}ms" >> $LOG_FILE
# Trigger alert — send via Tor-based messaging
fiRun this script via cron every 5-10 minutes. Tor circuit establishment adds latency, so set a generous timeout (60 seconds) and consider that first-circuit latency will be higher than subsequent requests on the same circuit.
Prometheus Metrics for Tor Services
Expose Tor daemon metrics to Prometheus for comprehensive monitoring. Tor supports MetricsPort since version 0.4.7, which provides Prometheus-compatible metrics:
# /etc/tor/torrc — Enable metrics
MetricsPort 127.0.0.1:9035
MetricsPortPolicy accept 127.0.0.1# prometheus.yml — Scrape Tor metrics
scrape_configs:
- job_name: "tor"
static_configs:
- targets: ["127.0.0.1:9035"]
scrape_interval: 30s
- job_name: "onion-health"
static_configs:
- targets: ["127.0.0.1:9100"]
scrape_interval: 300sKey metrics to monitor include tor_hs_intro_num_introductions (introduction requests — spikes may indicate DDoS), tor_relay_connections_total (connection counts), and tor_hs_desc_upload_total (descriptor publishing success). Set alerts on descriptor upload failures, as these mean your .onion address becomes unreachable.
Grafana Dashboard for .onion Services
Build a Grafana dashboard that visualizes your .onion service health, latency trends, and Tor daemon metrics. Key panels to include:
- Uptime percentage — calculated from health check success rate over 24h, 7d, 30d windows
- Latency histogram — response time distribution including Tor circuit overhead
- Introduction requests/sec — from Tor MetricsPort, useful for detecting DDoS ramp-up
- Descriptor publishing status — binary up/down indicator based on successful HS descriptor uploads
- Circuit count — active rendezvous circuits showing concurrent user connections
Configure Grafana alerting to notify you via privacy-respecting channels. Use a Tor-based Matrix or XMPP notification channel rather than email, which could expose your identity. Alternatively, send alerts to a separate .onion-accessible monitoring dashboard that you check periodically.
For multi-server setups with OnionBalance, create per-backend dashboards so you can identify which backend is underperforming and rebalance traffic accordingly.
AnubizHost — Monitored Tor Hosting
AnubizHost includes proactive monitoring on all managed Tor hosting plans. Our monitoring infrastructure connects to your .onion address over Tor from multiple circuits every five minutes, measuring uptime and latency. If your hidden service becomes unreachable, our team is alerted instantly and begins diagnosis.
Hosted on offshore servers in Iceland, Romania, and Finland with privacy-first infrastructure. Pay with Bitcoin, Monero, or other cryptocurrencies — no KYC required. Our pre-configured monitoring stack means you get Grafana dashboards and Prometheus metrics from day one, without any setup on your part.
Related Services
Why Anubiz Labs
Ready to get started?
Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.