From ff7106615e0e95b9fcce409ccad44ef521a1d6a2 Mon Sep 17 00:00:00 2001 From: Erkki Eilonen Date: Wed, 13 Jan 2016 21:09:01 +0700 Subject: [PATCH] fix block nesting bug causing filefd values to never be updated post initial call --- collector/filefd_linux.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/collector/filefd_linux.go b/collector/filefd_linux.go index 55c8d664..bb359af3 100644 --- a/collector/filefd_linux.go +++ b/collector/filefd_linux.go @@ -59,12 +59,12 @@ func (c *fileFDStatCollector) Update(ch chan<- prometheus.Metric) (err error) { Help: fmt.Sprintf("File descriptor statistics: %s.", name), }, ) - v, err := strconv.ParseFloat(value, 64) - if err != nil { - return fmt.Errorf("invalid value %s in file-nr: %s", value, err) - } - c.metrics[name].Set(v) } + v, err := strconv.ParseFloat(value, 64) + if err != nil { + return fmt.Errorf("invalid value %s in file-nr: %s", value, err) + } + c.metrics[name].Set(v) } for _, m := range c.metrics { m.Collect(ch)