Merge pull request #413 from prometheus/beorn7/registry

Be more robust about nil pointers in protobuf
This commit is contained in:
Björn Rabenstein 2018-05-29 19:01:24 +02:00 committed by GitHub
commit 42bc0a18c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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())
}
}