A lightweight Prometheus exporter written in Go that exposes detailed metrics from your AdGuard Home instance — including DNS statistics, blocked domains, upstreams, and client data.
- Authenticated access to AdGuard Home API
- Rich metrics: total queries, blocked queries, upstream stats, per-client stats
- Supported endpoints
/control/status
/control/stats
/control/querylog
- Customizable scrape interval
- Lightweight single binary or Docker container
Before running this exporter, make sure:
- AdGuard Home is up and running
- You have a valid AdGuard username & password
- Prometheus is configured to scrape this exporter
- Docker installed (or alternatively Go 1.20+ for building from source)
- Port
9617
is available on your system
To make sure the endpoint is valid, you can check the endpoints via curl
curl -v -u <yourusername>:<yourpassword> <ADGUARD_URL>:<PORT>/control/stats
curl -v -u <yourusername>:<yourpassword> <ADGUARD_URL>:<PORT>/control/status
curl -v -u <yourusername>:<yourpassword> <ADGUARD_URL>:<PORT>/control/querylog
Variable | Description | Required | Example |
---|---|---|---|
ADGUARD_HOST |
URL to your AdGuard Home API | ✅ | http://192.168.1.1:3000 |
ADGUARD_USER |
AdGuard Home username | ✅ | admin |
ADGUARD_PASS |
AdGuard Home password | ✅ | secretpassword |
EXPORTER_PORT |
Port to expose metrics (default: 9617) | ❌ | 9200 |
SCRAPE_INTERVAL |
How often to scrape (default: 15s) | ❌ | 30s |
LOG_LEVEL |
Log Level to analyze, INFO, WARN, DEBUG | ❌ | DEBUG ,WARN ,INFO |
docker run -d \
--name adguard_exporter \
--restart unless-stopped \
-p 9617:9617 \
-e ADGUARD_HOST=http://192.168.18.1 \
-e ADGUARD_USER=admin \
-e ADGUARD_PASS=mysecretpassword \
-e EXPORTER_PORT=9617 \
-e SCRAPE_INTERVAL=15s \
-e LOG_LEVEL=DEBUG
znanddev/adguard-exporter:latest
version: '3.8'
services:
adguard-exporter:
image: znanddev/adguard-exporter:latest
container_name: adguard_exporter
restart: unless-stopped
ports:
- "9617:9617"
environment:
- ADGUARD_URL=http://192.168.18.1
- ADGUARD_USERNAME=admin
- ADGUARD_PASSWORD=admin
- EXPORTER_PORT=9617
- SCRAPE_INTERVAL=15s
docker-compose up -d
Once running, your exporter will be available at:
http://<host>:9617/metrics
Ready to scrape by Prometheus!
- job_name: 'adguard-exporter'
scrape_interval: 15s
static_configs:
- targets: ['adguard-exporter:9617']
This exporter exposes the following metrics from AdGuard Home:
adguard_protection_enabled
: Whether DNS filtering is enabledadguard_running
: Whether AdGuard Home is runningadguard_queries
: Total DNS queries in the last 24 hoursadguard_blocked_filtered
: Queries blocked by filter listsadguard_blocked_safesearch
: Queries blocked due to SafeSearchadguard_blocked_safebrowsing
: Queries blocked due to SafeBrowsingadguard_avg_processing_time_seconds
: Average DNS query processing time in secondsadguard_scrape_errors_total
: Total number of scrape errorsadguard_dhcp_enabled
: Whether DHCP server is enabledadguard_dhcp_leases
: Number of active DHCP leases
Metrics with labels:
adguard_top_queried_domains{domain="example.com"}
adguard_top_blocked_domains{domain="ads.example.com"}
adguard_top_clients{client="192.168.1.2"}
adguard_top_upstreams{upstream="8.8.8.8"}
adguard_top_upstreams_avg_response_time_seconds{upstream="8.8.8.8"}
This project is licensed under the MIT License — see the LICENSE file for details.
Grafana Dashboard Preview
Live preview and monitoring, click here
Pull Requests, Issues, and Suggestions are always welcome!
Made with ❤️ by znanddev