File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ const (
25
25
// See: https://github.com/go-sql-driver/mysql#system-variables
26
26
sessionSettingsParam = `log_slow_filter=%27tmp_table_on_disk,filesort_on_disk%27`
27
27
timeoutParam = `lock_wait_timeout=%d`
28
-
29
- upQuery = `SELECT 1`
30
28
)
31
29
32
30
// Tunable flags.
@@ -117,14 +115,12 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
117
115
// Set max lifetime for a connection.
118
116
db .SetConnMaxLifetime (1 * time .Minute )
119
117
120
- isUpRows , err := db .Query (upQuery )
121
- if err != nil {
118
+ if err := db .Ping (); err != nil {
122
119
log .Errorln ("Error pinging mysqld:" , err )
123
120
e .metrics .MySQLUp .Set (0 )
124
121
e .metrics .Error .Set (1 )
125
122
return
126
123
}
127
- isUpRows .Close ()
128
124
129
125
e .metrics .MySQLUp .Set (1 )
130
126
You can’t perform that action at this time.
0 commit comments