system: BREAKING rename windows_system_system_up_time to windows_system_boot_time_timestamp_seconds (#1784)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-11-29 22:19:14 +01:00
committed by GitHub
parent a2db81494e
commit aaa4ce07f6
3 changed files with 21 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ type Collector struct {
processes *prometheus.Desc
processesLimit *prometheus.Desc
systemCallsTotal *prometheus.Desc
systemUpTime *prometheus.Desc
bootTime *prometheus.Desc
threads *prometheus.Desc
}
@@ -92,6 +92,12 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
return fmt.Errorf("failed to create System collector: %w", err)
}
c.bootTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "boot_time_timestamp_seconds"),
"Unix timestamp of system boot time",
nil,
nil,
)
c.contextSwitchesTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "context_switches_total"),
"Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)",
@@ -129,12 +135,6 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
nil,
nil,
)
c.systemUpTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "system_up_time"),
"System boot time (WMI source: PerfOS_System.SystemUpTime)",
nil,
nil,
)
c.threads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "threads"),
"Current number of threads (WMI source: PerfOS_System.Threads)",
@@ -184,7 +184,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
data[systemCallsPersec].FirstValue,
)
ch <- prometheus.MustNewConstMetric(
c.systemUpTime,
c.bootTime,
prometheus.GaugeValue,
data[systemUpTime].FirstValue,
)