From dd6bfbe96329fed47bcd79647297f46de9a342ee Mon Sep 17 00:00:00 2001 From: paologallinaharbur Date: Fri, 29 May 2020 11:14:23 +0200 Subject: [PATCH] fix: changed label name, added documentation Signed-off-by: paologallinaharbur --- collector/service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/collector/service.go b/collector/service.go index 76d77c85..a5b50c65 100644 --- a/collector/service.go +++ b/collector/service.go @@ -45,7 +45,7 @@ func NewserviceCollector() (Collector, error) { Information: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "info"), "A metric with a constant '1' value labeled with service information", - []string{"name", "display_name", "process_id", "start_name"}, + []string{"name", "display_name", "process_id", "run_as"}, nil, ), State: prometheus.NewDesc( @@ -135,9 +135,9 @@ func (c *serviceCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Des for _, service := range dst { pid := strconv.FormatUint(uint64(service.ProcessId), 10) - startName := "" + runAs := "" if service.StartName != nil { - startName = *service.StartName + runAs = *service.StartName } ch <- prometheus.MustNewConstMetric( c.Information, @@ -146,7 +146,7 @@ func (c *serviceCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Des strings.ToLower(service.Name), service.DisplayName, pid, - startName, + runAs, ) for _, state := range allStates {