diff --git a/plugins/mysql/mysql.go b/plugins/mysql/mysql.go index 15b1af8c9..2e9e2cd22 100644 --- a/plugins/mysql/mysql.go +++ b/plugins/mysql/mysql.go @@ -91,7 +91,7 @@ func (m *Mysql) gatherServer(serv string, acc plugins.Accumulator) error { rows, err := db.Query(`SHOW /*!50002 GLOBAL */ STATUS`) if err != nil { - return nil + return err } for rows.Next() { diff --git a/plugins/mysql/mysql_test.go b/plugins/mysql/mysql_test.go index 33643861a..76cb28b0d 100644 --- a/plugins/mysql/mysql_test.go +++ b/plugins/mysql/mysql_test.go @@ -39,7 +39,7 @@ func TestMysqlGeneratesMetrics(t *testing.T) { var count int for _, p := range acc.Points { - if strings.HasPrefix(p.Name, prefix.prefix) { + if strings.HasPrefix(p.Measurement, prefix.prefix) { count++ } }