Tolerate MetricFamily with unset type.

In that case, the default value is chosen (COUNTER for historical
reasons.)

Change-Id: I8f3384feee7f3bbaa837b216b0885ad238d1e0e5
This commit is contained in:
Bjoern Rabenstein 2014-11-05 13:05:06 +01:00
parent f4be228ba0
commit c53c07a719
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ func (m *metricFamilyProcessor) ProcessSingle(i io.Reader, out Ingester, o *Proc
} }
func extractMetricFamily(out Ingester, o *ProcessOptions, family *dto.MetricFamily) error { func extractMetricFamily(out Ingester, o *ProcessOptions, family *dto.MetricFamily) error {
switch *family.Type { switch family.GetType() {
case dto.MetricType_COUNTER: case dto.MetricType_COUNTER:
if err := extractCounter(out, o, family); err != nil { if err := extractCounter(out, o, family); err != nil {
return err return err