From a26ffaf4f84521e2c0e9ce035902bb00957ebcb6 Mon Sep 17 00:00:00 2001 From: Li Ling Date: Thu, 20 Aug 2020 14:18:57 +0200 Subject: [PATCH] Failed conntrack update should return success=0 (#1323, #1723) Signed-off-by: Li Ling --- collector/conntrack_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/conntrack_linux.go b/collector/conntrack_linux.go index 9dc8114f..8b60018d 100644 --- a/collector/conntrack_linux.go +++ b/collector/conntrack_linux.go @@ -51,14 +51,14 @@ func (c *conntrackCollector) Update(ch chan<- prometheus.Metric) error { value, err := readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_count")) if err != nil { // Conntrack probably not loaded into the kernel. - return nil + return err } ch <- prometheus.MustNewConstMetric( c.current, prometheus.GaugeValue, float64(value)) value, err = readUintFromFile(procFilePath("sys/net/netfilter/nf_conntrack_max")) if err != nil { - return nil + return err } ch <- prometheus.MustNewConstMetric( c.limit, prometheus.GaugeValue, float64(value))