Only lowercase mysql slave metrics with metric_version = 2

This commit is contained in:
Daniel Nelson 2018-05-04 14:31:16 -07:00
parent 81620c69c5
commit 8b687a8e21
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 3 additions and 1 deletions

View File

@ -608,7 +608,9 @@ func (m *Mysql) gatherSlaveStatuses(db *sql.DB, serv string, acc telegraf.Accumu
} }
// range over columns, and try to parse values // range over columns, and try to parse values
for i, col := range cols { for i, col := range cols {
if m.MetricVersion >= 2 {
col = strings.ToLower(col) col = strings.ToLower(col)
}
if value, ok := m.parseValue(*vals[i].(*sql.RawBytes)); ok { if value, ok := m.parseValue(*vals[i].(*sql.RawBytes)); ok {
fields["slave_"+col] = value fields["slave_"+col] = value
} }