Skip to content

Commit

Permalink
Merge pull request ClickHouse#13 from AlekSi/master
Browse files Browse the repository at this point in the history
Fix broken parts scrape.
  • Loading branch information
f1yegor committed Sep 26, 2017
2 parents 028a125 + d384ca5 commit a4ff954
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clickhouse_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"strconv"
"strings"
"sync"

"unicode"

"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -223,7 +222,7 @@ func (e *Exporter) parseKeyValueResponse(uri string) ([]lineResult, error) {
continue
}
if len(parts) != 2 {
return nil, fmt.Errorf("Unexpected %d line: %s", i, line)
return nil, fmt.Errorf("parseKeyValueResponse: unexpected %d line: %s", i, line)
}
k := strings.TrimSpace(parts[0])
v, err := strconv.Atoi(strings.TrimSpace(parts[1]))
Expand Down Expand Up @@ -259,8 +258,8 @@ func (e *Exporter) parsePartsResponse(uri string) ([]partsResult, error) {
if len(parts) == 0 {
continue
}
if len(parts) != 4 {
return nil, fmt.Errorf("Unexpected %d line: %s", i, line)
if len(parts) != 5 {
return nil, fmt.Errorf("parsePartsResponse: unexpected %d line: %s", i, line)
}
database := strings.TrimSpace(parts[0])
table := strings.TrimSpace(parts[1])
Expand Down

0 comments on commit a4ff954

Please sign in to comment.