1
0
mirror of https://github.com/prometheus/mysqld_exporter.git synced 2025-07-30 06:43:05 +03:00

Add minimal MySQL version to Scraper interface (#328)

* Add Version method to Scraper interface.
* Skip scrapers for unsupported MySQL versions.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@percona.com>
This commit is contained in:
Alexey Palazhchenko
2018-10-29 18:35:38 +03:00
committed by Ben Kochie
parent ff14a3d4cb
commit 1465a0b0e0
30 changed files with 267 additions and 8 deletions

View File

@ -25,9 +25,14 @@ import (
type Scraper interface {
// Name of the Scraper. Should be unique.
Name() string
// Help describes the role of the Scraper.
// Example: "Collect from SHOW ENGINE INNODB STATUS"
Help() string
// Version of MySQL from which scraper is available.
Version() float64
// Scrape collects data from database connection and sends it over channel as prometheus metric.
Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
}