AdGuard Metrics Statistics

A powerful Grafana dashboard for monitoring AdGuard Home DNS performance using Prometheus as the data source.

AdGuard Metrics Statistics screenshot 1
AdGuard Metrics Statistics screenshot 2

AdGuard Exporter for Prometheus

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.


Prerequisites

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 9600 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

Environment Variables

VariableDescriptionRequiredExample
ADGUARD_HOSTURL to your AdGuard Home APIhttp://192.168.1.1:3000
ADGUARD_USERAdGuard Home usernameadmin
ADGUARD_PASSAdGuard Home passwordsecretpassword
EXPORTER_PORTPort to expose metrics (default: 9617)9200
SCRAPE_INTERVALHow often to scrape (default: 15s)30s
LOG_LEVELLog Level to analyze, INFO, WARN, DEBUGDEBUG,WARN,INFO

Run via Docker

Quick Start (Inline ENV)

bash
docker run -d \
  --name adguard_exporter \
  --restart unless-stopped \
  -p 9200:9200 \
  -e ADGUARD_HOST=http://192.168.18.1 \
  -e ADGUARD_USER=admin \
  -e ADGUARD_PASS=mysecretpassword \
  -e EXPORTER_PORT=9200 \
  -e SCRAPE_INTERVAL=15s \
  -e LOG_LEVEL=DEBUG
 gchr.io/znand-dev/adguardexporter:latest

Run via Docker Compose

1. Create docker-compose.yml in your root dir

yaml
version: '3.8'

services:
  adguard-exporter:
    image: gchr.io/znand-dev/adguardexporter:latest
    container_name: adguard_exporter
    restart: unless-stopped
    ports:
      - "9200:9200"
    environment:
      - ADGUARD_URL=http://192.168.18.1
      - ADGUARD_USERNAME=admin
      - ADGUARD_PASSWORD=admin
      - EXPORTER_PORT=9200
      - SCRAPE_INTERVAL=15s

2. Run with Docker Compose

bash
docker-compose up -d

Metrics Endpoint

Once running, your exporter will be available at:

http://<host>:9200/metrics

Ready to scrape by Prometheus!


Example Prometheus Job

yaml
- job_name: 'adguard-exporter'
  scrape_interval: 15s
  static_configs:
    - targets: ['adguard-exporter:9200']

Available Prometheus Metrics

This exporter exposes the following metrics from AdGuard Home:

  • adguard_protection_enabled: Whether DNS filtering is enabled
  • adguard_running: Whether AdGuard Home is running
  • adguard_queries: Total DNS queries in the last 24 hours
  • adguard_blocked_filtered: Queries blocked by filter lists
  • adguard_blocked_safesearch: Queries blocked due to SafeSearch
  • adguard_blocked_safebrowsing: Queries blocked due to SafeBrowsing
  • adguard_avg_processing_time_seconds: Average DNS query processing time in seconds
  • adguard_scrape_errors_total: Total number of scrape errors
  • adguard_dhcp_enabled: Whether DHCP server is enabled
  • adguard_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"}

Grafana Dashboard Preview

Live preview and monitoring, click here

Made with ❤️ by znanddev

Revisions
RevisionDescriptionCreated

Get this dashboard

Import the dashboard template

or

Download JSON

Datasource
Dependencies