From 9ea37d8b44eb32fc177f41aa437d7ec909b4f601 Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Tue, 30 Jul 2013 16:08:54 +0200 Subject: [PATCH] Skip failing runit services + fix metric names --- exporter/runit_collector.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exporter/runit_collector.go b/exporter/runit_collector.go index 8d85d604..f48f4f6f 100644 --- a/exporter/runit_collector.go +++ b/exporter/runit_collector.go @@ -31,14 +31,14 @@ func NewRunitCollector(config config, registry prometheus.Registry) (runitCollec registry.Register( "node_service_desired_state", - "node_exporter: desired status of runit service.", + "node_exporter: desired state of runit service.", prometheus.NilLabels, c.stateDesired, ) registry.Register( "node_service_normal_state", - "node_exporter: status of runit service.", + "node_exporter: normal state of runit service.", prometheus.NilLabels, c.stateNormal, ) @@ -57,7 +57,8 @@ func (c *runitCollector) Update() (updates int, err error) { for _, service := range services { status, err := service.Status() if err != nil { - return 0, err + debug(c.Name(), "Couldn't get status for %s: %s, skipping...", service.Name, err) + continue } debug(c.Name(), "%s is %d on pid %d for %d seconds", service.Name, status.State, status.Pid, status.Duration)