You've already forked mysqld_exporter
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:
committed by
Ben Kochie
parent
ff14a3d4cb
commit
1465a0b0e0
@ -73,6 +73,11 @@ func (ScrapePerfFileInstances) Help() string {
|
||||
return "Collect metrics from performance_schema.file_summary_by_instance"
|
||||
}
|
||||
|
||||
// Version of MySQL from which scraper is available.
|
||||
func (ScrapePerfFileInstances) Version() float64 {
|
||||
return 5.5
|
||||
}
|
||||
|
||||
// Scrape collects data from database connection and sends it over channel as prometheus metric.
|
||||
func (ScrapePerfFileInstances) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error {
|
||||
// Timers here are returned in picoseconds.
|
||||
@ -118,3 +123,6 @@ func (ScrapePerfFileInstances) Scrape(ctx context.Context, db *sql.DB, ch chan<-
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// check interface
|
||||
var _ Scraper = ScrapePerfFileInstances{}
|
||||
|
Reference in New Issue
Block a user