merlijntishauser/pihole-sqlite-exporter

By merlijntishauser

Updated 4 months ago

A metrics exporter for PiHole, working directly on the sqlite database of pihole. Written in Python.

Image
Networking
1

2.7K

merlijntishauser/pihole-sqlite-exporter repository overview

pihole-sqlite-exporter

Prometheus exporter that reads Pi-hole metrics directly from pihole-FTL.db (and optionally gravity.db) without using the Pi-hole HTTP API.

Why this exists

  • Avoids API calls, auth, TLS, and timeout issues.
  • Uses read-only SQLite access to keep the exporter lightweight and safe.
  • Works well in constrained environments (NAS, containers, or edge devices).

How it works

  • Connects read-only to Pi-hole's SQLite databases.
  • Computes daily counters, top lists, and request-rate metrics.
  • Exposes Prometheus metrics on /metrics via a tiny HTTP server.

Image and build choices

  • Multi-arch images are published for linux/amd64 and linux/arm64 so the same tag runs on x86 servers, NAS devices, and ARM boards.
  • Uses a hardened runtime base (dhi.io/python:3-alpine3.22) with a minimal footprint, non-root default user, and a simple healthcheck.
  • Alpine keeps the image small and limits the attack surface; the hardened base emphasizes secure defaults and a trimmed runtime.

Repository Overview

Tag summary

Content type

Image

Digest

sha256:bc7408736

Size

15.2 MB

Last updated

4 months ago

docker pull merlijntishauser/pihole-sqlite-exporter:sha-fe3e19a