From fb275a06fe3e2e5d87fb943bb900bc216fa78808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Thu, 12 Sep 2024 19:35:12 +0200 Subject: [PATCH] service: fix label name in `windows_service_state` (#1625) --- docs/collector.service.md | 28 ++++++++++++++-------------- pkg/collector/service/service.go | 2 +- tools/e2e-output.txt | 14 +++++++------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/collector.service.md b/docs/collector.service.md index c8d97222..dc0bb9f0 100644 --- a/docs/collector.service.md +++ b/docs/collector.service.md @@ -72,20 +72,20 @@ windows_service_start_mode{name="dcsvc",start_mode="manual"} 1 windows_service_start_mode{name="dcsvc",start_mode="system"} 0 # HELP windows_service_state The state of the service (State) # TYPE windows_service_state gauge -windows_service_state{name="Themes",status="continue pending"} 0 -windows_service_state{name="Themes",status="pause pending"} 0 -windows_service_state{name="Themes",status="paused"} 0 -windows_service_state{name="Themes",status="running"} 1 -windows_service_state{name="Themes",status="start pending"} 0 -windows_service_state{name="Themes",status="stop pending"} 0 -windows_service_state{name="Themes",status="stopped"} 0 -windows_service_state{name="dcsvc",status="continue pending"} 0 -windows_service_state{name="dcsvc",status="pause pending"} 0 -windows_service_state{name="dcsvc",status="paused"} 0 -windows_service_state{name="dcsvc",status="running"} 0 -windows_service_state{name="dcsvc",status="start pending"} 0 -windows_service_state{name="dcsvc",status="stop pending"} 0 -windows_service_state{name="dcsvc",status="stopped"} 1 +windows_service_state{name="Themes",state="continue pending"} 0 +windows_service_state{name="Themes",state="pause pending"} 0 +windows_service_state{name="Themes",state="paused"} 0 +windows_service_state{name="Themes",state="running"} 1 +windows_service_state{name="Themes",state="start pending"} 0 +windows_service_state{name="Themes",state="stop pending"} 0 +windows_service_state{name="Themes",state="stopped"} 0 +windows_service_state{name="dcsvc",state="continue pending"} 0 +windows_service_state{name="dcsvc",state="pause pending"} 0 +windows_service_state{name="dcsvc",state="paused"} 0 +windows_service_state{name="dcsvc",state="running"} 0 +windows_service_state{name="dcsvc",state="start pending"} 0 +windows_service_state{name="dcsvc",state="stop pending"} 0 +windows_service_state{name="dcsvc",state="stopped"} 1 ``` ## Useful queries diff --git a/pkg/collector/service/service.go b/pkg/collector/service/service.go index 9b1f8237..1f4bc6ee 100644 --- a/pkg/collector/service/service.go +++ b/pkg/collector/service/service.go @@ -122,7 +122,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *wmi.Client) error { c.state = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "state"), "The state of the service (State)", - []string{"name", "status"}, + []string{"name", "state"}, nil, ) c.startMode = prometheus.NewDesc( diff --git a/tools/e2e-output.txt b/tools/e2e-output.txt index ea2681c7..72a0dc05 100644 --- a/tools/e2e-output.txt +++ b/tools/e2e-output.txt @@ -298,13 +298,13 @@ windows_service_start_mode{name="Themes",start_mode="manual"} 0 windows_service_start_mode{name="Themes",start_mode="system"} 0 # HELP windows_service_state The state of the service (State) # TYPE windows_service_state gauge -windows_service_state{name="Themes",status="continue pending"} 0 -windows_service_state{name="Themes",status="pause pending"} 0 -windows_service_state{name="Themes",status="paused"} 0 -windows_service_state{name="Themes",status="running"} 1 -windows_service_state{name="Themes",status="start pending"} 0 -windows_service_state{name="Themes",status="stop pending"} 0 -windows_service_state{name="Themes",status="stopped"} 0 +windows_service_state{name="Themes",state="continue pending"} 0 +windows_service_state{name="Themes",state="pause pending"} 0 +windows_service_state{name="Themes",state="paused"} 0 +windows_service_state{name="Themes",state="running"} 1 +windows_service_state{name="Themes",state="start pending"} 0 +windows_service_state{name="Themes",state="stop pending"} 0 +windows_service_state{name="Themes",state="stopped"} 0 # HELP windows_system_context_switches_total Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec) # TYPE windows_system_context_switches_total counter # HELP windows_system_exception_dispatches_total Total number of exceptions dispatched (WMI source: PerfOS_System.ExceptionDispatchesPersec)