Skip to content

Repository files navigation

vsql-prometheus-exporter

CI

Prometheus exporter extension for VillageSQL Server, built using the VillageSQL Extension Framework (VEF).

Exposes MySQL server metrics at an HTTP /metrics endpoint in Prometheus exposition format.

Metrics

PrefixSourceDescription
mysql_global_status_SHOW GLOBAL STATUSServer status variables
mysql_global_variables_SHOW GLOBAL VARIABLESNumeric server variables
mysql_info_schema_innodb_metrics_information_schema.innodb_metricsInnoDB internal metrics
mysql_replica_SHOW REPLICA STATUSReplication status (when applicable)

Built-in operational metrics:

MetricDescription
requests_totalTotal HTTP scrape requests
scrape_duration_usScrape duration in microseconds
errors_totalTotal scrape errors

System Variables

VariableDefaultDescription
prometheus_exporter.enabledOFFEnable/disable the exporter
prometheus_exporter.port9104HTTP listen port
prometheus_exporter.bind_address127.0.0.1HTTP listen address

CI Testing

Every pull request is tested against VillageSQL Server (tomas/dev branch). The CI workflow:

  1. Builds VillageSQL Server from source
  2. Builds the extension and packages it as a .veb bundle
  3. Runs the MTR test suite with 6 tests:
TestWhat it verifies
basicInstall/uninstall lifecycle, system variables, HTTP listener start/stop
format_validationPrometheus exposition format correctness (metric lines, numeric values)
global_variablesmysql_global_variables_ metrics exported for known numeric variables
metrics_endpointHTTP 200 on /metrics, 404 on unknown paths, all collector prefixes present
replica_statusmysql_replica_* metrics behavior on non-replica server
scrape_counterrequests_total increments per scrape, scrape_duration_us > 0, no errors

Quick Start

INSTALL EXTENSION prometheus_exporter;
SET GLOBAL prometheus_exporter.port=9104;
SET GLOBAL prometheus_exporter.enabled=ON;

Then scrape http://127.0.0.1:9104/metrics.

About

VillageSQL extension: embedded Prometheus metrics exporter

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages