From c53c07a719a477ad320e765b73eaaffd05d611b0 Mon Sep 17 00:00:00 2001 From: Bjoern Rabenstein Date: Wed, 5 Nov 2014 13:05:06 +0100 Subject: [PATCH] Tolerate MetricFamily with unset type. In that case, the default value is chosen (COUNTER for historical reasons.) Change-Id: I8f3384feee7f3bbaa837b216b0885ad238d1e0e5 --- extraction/metricfamilyprocessor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extraction/metricfamilyprocessor.go b/extraction/metricfamilyprocessor.go index ff6501f..2f8ccb5 100644 --- a/extraction/metricfamilyprocessor.go +++ b/extraction/metricfamilyprocessor.go @@ -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 { - switch *family.Type { + switch family.GetType() { case dto.MetricType_COUNTER: if err := extractCounter(out, o, family); err != nil { return err