finds.dev← search

// the find

justwatchcom/sql_exporter

★ 501 · Go · MIT · updated Sep 2025

Flexible SQL Exporter for Prometheus.

A Prometheus exporter that runs arbitrary SQL queries against your database and exposes the results as metrics. Works against Postgres, MySQL, ClickHouse, Snowflake, Athena, and a handful of others. If you need to turn a business query into a gauge or counter without writing a custom exporter, this covers it.

The iterator pattern is genuinely useful — you can fan a single query out across multiple databases dynamically rather than hardcoding N connection blocks. Cron scheduling alongside fixed intervals is a nice touch for metrics that only make sense daily. The non-superuser Postgres setup with SECURITY DEFINER functions is documented and works, which most similar tools skip entirely. Cloud-native integrations (CloudSQL wildcard, RDS IAM auth) are first-class, not bolted on.

501 stars and still on Travis CI with a badge that's likely broken — the maintenance posture is unclear. No concept of query timeouts; a runaway analytical query will block the scrape endpoint for however long Postgres takes. Error handling on query failure is not described — it's not obvious whether a failed query silently emits nothing or whether the scrape itself 500s. The iterator feature runs an extra query per job per scrape interval, which compounds if you're iterating over hundreds of databases with tight intervals.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →