Skip to content

feat(metrics): add collector for sql.DBSats

João Pereira requested to merge 30-sql-stats into master

This MR adds a Prometheus collector to expose sql.DBStats metrics.

Note: This implementation is heavily inspired by https://github.com/dlmiddlecote/sqlstats. I thought about embedding/wrapping this dependency, but given how simple the code is, I decided to replicate it here with a few changes:

  • Functional options to configure the collector, aligned with the rest of the LabKit API;
  • Custom metric names that conform with our style/conventions;
  • Granular tests.

Related to #30.

Edited by João Pereira

Merge request reports