Merge pull request #80 from peterbourgon/histogram-registry-fix

Fix for Histogram in registry.writePB
This commit is contained in:
Björn Rabenstein 2015-02-20 19:23:41 +01:00
commit 54238dea8f
1 changed files with 2 additions and 0 deletions

View File

@ -464,6 +464,8 @@ func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) {
metricFamily.Type = dto.MetricType_SUMMARY.Enum()
case dtoMetric.Untyped != nil:
metricFamily.Type = dto.MetricType_UNTYPED.Enum()
case dtoMetric.Histogram != nil:
metricFamily.Type = dto.MetricType_HISTOGRAM.Enum()
default:
return 0, fmt.Errorf("empty metric collected: %s", dtoMetric)
}