Skip to main content
Scraping MySQL for Prometheus usually means running a separate exporter process that logs in and polls. prometheus_exporter serves the /metrics endpoint from inside the server instead, so there is one fewer process to deploy, authenticate, and keep alive.
A third party writes and maintains this extension. VillageSQL does not build, test, or ship it, and the description below follows the maintainer’s own documentation. Read that documentation before you rely on it.

Install

The code on the repository’s default branch does not build against the current SDK: it calls make_sys_var_bool and make_status_var_int, which left the SDK in May 2026. The ported code is on the maintainer’s open pull request #4, which declares preview capabilities, so a server built from it must be started with --vsql_allow_preview_extensions=ON.
Build it from that branch, then install it into the server:

What it adds

It adds an HTTP listener and three settings, and no SQL functions. Four families of metric are exported, each named after where it came from. The exporter also reports on itself through requests_total, scrape_duration_us, and errors_total.

Example

The maintainer’s quick start turns it on and picks a port:
Prometheus then scrapes http://127.0.0.1:9104/metrics.
The listener binds to localhost unless you change it, which is the safe choice. Metrics describe your traffic and configuration, so put the port behind something that authenticates before you move it off the loopback address.

See also