You've already forked mysqld_exporter
mirror of
https://github.com/prometheus/mysqld_exporter.git
synced 2025-07-31 17:44:21 +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:
committed by
Ben Kochie
parent
ff14a3d4cb
commit
1465a0b0e0
@ -66,6 +66,11 @@ func (ScrapeInfoSchemaInnodbTablespaces) Help() string {
|
||||
return "Collect metrics from information_schema.innodb_sys_tablespaces"
|
||||
}
|
||||
|
||||
// Version of MySQL from which scraper is available.
|
||||
func (ScrapeInfoSchemaInnodbTablespaces) Version() float64 {
|
||||
return 5.7
|
||||
}
|
||||
|
||||
// Scrape collects data from database connection and sends it over channel as prometheus metric.
|
||||
func (ScrapeInfoSchemaInnodbTablespaces) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error {
|
||||
tablespacesRows, err := db.QueryContext(ctx, innodbTablespacesQuery)
|
||||
@ -113,3 +118,6 @@ func (ScrapeInfoSchemaInnodbTablespaces) Scrape(ctx context.Context, db *sql.DB,
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// check interface
|
||||
var _ Scraper = ScrapeInfoSchemaInnodbTablespaces{}
|
||||
|
Reference in New Issue
Block a user