Skip to content

Commit

Permalink
Only lowercase mysql slave metrics with metric_version = 2
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed May 4, 2018
1 parent 81620c6 commit 8b687a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/inputs/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,9 @@ func (m *Mysql) gatherSlaveStatuses(db *sql.DB, serv string, acc telegraf.Accumu
}
// range over columns, and try to parse values
for i, col := range cols {
col = strings.ToLower(col)
if m.MetricVersion >= 2 {
col = strings.ToLower(col)
}
if value, ok := m.parseValue(*vals[i].(*sql.RawBytes)); ok {
fields["slave_"+col] = value
}
Expand Down

0 comments on commit 8b687a8

Please sign in to comment.