From ed15b3c6715fe4edd26b342a8dd9b7be21e4a53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 5 Jul 2025 15:40:09 +0200 Subject: [PATCH] system: remove windows_system_boot_time_timestamp_seconds (#2112) --- internal/collector/process/process.go | 9 --------- internal/collector/process/process_worker.go | 7 ------- internal/collector/system/system.go | 18 ++---------------- tools/e2e-output.txt | 2 -- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/internal/collector/process/process.go b/internal/collector/process/process.go index d99ecd15..e8fc4f47 100644 --- a/internal/collector/process/process.go +++ b/internal/collector/process/process.go @@ -81,8 +81,6 @@ type Collector struct { poolBytes *prometheus.Desc priorityBase *prometheus.Desc privateBytes *prometheus.Desc - // Deprecated: Use start_time_seconds_timestamp instead - startTimeOld *prometheus.Desc startTime *prometheus.Desc threadCount *prometheus.Desc virtualBytes *prometheus.Desc @@ -221,13 +219,6 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error { nil, ) - c.startTimeOld = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "start_time"), - "DEPRECATED: Use start_time_seconds_timestamp instead", - []string{"process", "process_id"}, - nil, - ) - c.startTime = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "start_time_seconds_timestamp"), "Time of process start.", diff --git a/internal/collector/process/process_worker.go b/internal/collector/process/process_worker.go index 9c499a40..d1e30043 100644 --- a/internal/collector/process/process_worker.go +++ b/internal/collector/process/process_worker.go @@ -146,13 +146,6 @@ func (c *Collector) collectWorker() { startTime := float64(time.Now().UnixMicro())/1e6 - data.ElapsedTime - ch <- prometheus.MustNewConstMetric( - c.startTimeOld, - prometheus.GaugeValue, - startTime, - name, pidString, - ) - ch <- prometheus.MustNewConstMetric( c.startTime, prometheus.GaugeValue, diff --git a/internal/collector/system/system.go b/internal/collector/system/system.go index 2494c294..5bec3fda 100644 --- a/internal/collector/system/system.go +++ b/internal/collector/system/system.go @@ -52,10 +52,8 @@ type Collector struct { processes *prometheus.Desc processesLimit *prometheus.Desc systemCallsTotal *prometheus.Desc - // Deprecated: Use windows_system_boot_time_timestamp instead - bootTimeSeconds *prometheus.Desc - bootTime *prometheus.Desc - threads *prometheus.Desc + bootTime *prometheus.Desc + threads *prometheus.Desc } func New(config *Config) *Collector { @@ -91,12 +89,6 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error { nil, nil, ) - c.bootTimeSeconds = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "boot_time_timestamp_seconds"), - "Deprecated: Use windows_system_boot_time_timestamp instead", - nil, - nil, - ) c.contextSwitchesTotal = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "context_switches_total"), "Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)", @@ -199,12 +191,6 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error { c.perfDataObject[0].Threads, ) - ch <- prometheus.MustNewConstMetric( - c.bootTimeSeconds, - prometheus.GaugeValue, - c.bootTimeTimestamp, - ) - ch <- prometheus.MustNewConstMetric( c.bootTime, prometheus.GaugeValue, diff --git a/tools/e2e-output.txt b/tools/e2e-output.txt index b091841c..ea3140d1 100644 --- a/tools/e2e-output.txt +++ b/tools/e2e-output.txt @@ -387,8 +387,6 @@ windows_service_state{name="Themes",state="stop pending"} 0 windows_service_state{name="Themes",state="stopped"} 0 # HELP windows_system_boot_time_timestamp Unix timestamp of system boot time # TYPE windows_system_boot_time_timestamp gauge -# HELP windows_system_boot_time_timestamp_seconds Deprecated: Use windows_system_boot_time_timestamp instead -# TYPE windows_system_boot_time_timestamp_seconds gauge # 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)