Skip to content

Commit

Permalink
better exporter family series append
Browse files Browse the repository at this point in the history
  • Loading branch information
portertech committed Oct 2, 2017
1 parent 55287c5 commit 1750782
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sensu-prometheus-collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func QueryExporter(exporterURL string) (model.Vector, error) {
}

if expResponse.StatusCode != http.StatusOK {
return nil, errors.New("non OK HTTP response status")
return nil, errors.New("exporter returned non OK HTTP response status")
}

var parser expfmt.TextParser
Expand All @@ -165,10 +165,7 @@ func QueryExporter(exporterURL string) (model.Vector, error) {

for _, family := range metricFamilies {
familySamples, _ := expfmt.ExtractSamples(decodeOptions, family)

for _, sample := range familySamples {
samples = append(samples, sample)
}
samples = append(samples, familySamples...)
}

return samples, nil
Expand Down

0 comments on commit 1750782

Please sign in to comment.