Skip to content

Commit

Permalink
Merge pull request prometheus#413 from prometheus/beorn7/registry
Browse files Browse the repository at this point in the history
Be more robust about nil pointers in protobuf
  • Loading branch information
beorn7 authored May 29, 2018
2 parents c51dc75 + 1b56b5c commit 42bc0a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prometheus/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ func checkMetricConsistency(
}

for _, labelPair := range dtoMetric.GetLabel() {
if !utf8.ValidString(*labelPair.Value) {
return fmt.Errorf("collected metric's label %s is not utf8: %#v", *labelPair.Name, *labelPair.Value)
if !utf8.ValidString(labelPair.GetValue()) {
return fmt.Errorf("collected metric's label %s is not utf8: %#v", labelPair.GetName(), labelPair.GetValue())
}
}

Expand Down

0 comments on commit 42bc0a1

Please sign in to comment.