Skip to content

Commit

Permalink
service: fix label name in windows_service_state (#1625)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored Sep 12, 2024
1 parent 064ea74 commit fb275a0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
28 changes: 14 additions & 14 deletions docs/collector.service.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/collector/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
14 changes: 7 additions & 7 deletions tools/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fb275a0

Please sign in to comment.