forked from mirror/client_golang
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:
parent
f4be228ba0
commit
c53c07a719
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue