Fix for Histogram in registry.writePB

This commit is contained in:
Peter Bourgon 2015-02-20 19:08:36 +01:00
parent bc1f2b27ad
commit 69c8dc87e9
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)
}