Skip to content

Commit 4db7f68

Browse files
committed
Log errors in parsing UTF-8
1 parent bbb622e commit 4db7f68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ func queryNamespaceMapping(ch chan<- prometheus.Metric, db *sql.DB, namespace st
123123
for i, label := range mapping.labels {
124124
for idx, columnName := range columnNames {
125125
if columnName == label {
126-
log.Debugf("Fetching data for row belonging to %s: %s", columnName, columnData[idx])
127126
labelValues[i] = columnData[idx].(string)
128127

129128
// Prometheus will fail hard if the database and usernames are not UTF-8
130129
if !utf8.ValidString(labelValues[i]) {
130+
nonfatalErrors = append(nonfatalErrors, errors.New(fmt.Sprintln("Column %s in %s has an invalid UTF-8 for a label: %s ", columnName, namespace, columnData[idx])))
131131
continue
132132
}
133133
}

0 commit comments

Comments
 (0)