// the find
burningalchemist/sql_exporter
Database-agnostic SQL Exporter for Prometheus
A Prometheus exporter that runs arbitrary SQL queries against your databases and exposes the results as metrics. Works across MySQL, Postgres, MSSQL, Oracle, ClickHouse, Snowflake, and Vertica from a single binary with a YAML config. The target audience is anyone running databases in a Prometheus stack who wants custom business or health metrics without writing a dedicated exporter.
The collector file abstraction is genuinely useful — you write SQL once, reference it by name across multiple targets, and share collector definitions across teams without copy-pasting. The per-query observability metrics (duration + row count) are a nice addition for diagnosing slow scrapes. Secret manager integrations (AWS, GCP, Vault, Kubernetes secrets) are first-class, not bolted on. The min_interval caching is a practical solution to expensive queries getting hammered on short Prometheus scrape intervals.
Secrets are only resolved at startup, so a rotated credential requires a restart or a config reload — not great for anything with short-lived tokens. The multi-target jobs mode uses a different config shape than the single-target mode, which means copy-pasting config examples without reading carefully will leave you confused about why nothing works. NULL values from queries are silently dropped with only a debug log, which can mask broken queries in production for a long time. No native support for parameterized queries means you can't safely inject dynamic values without SQL injection risk if you ever template the query files externally.