prometheus-community / windows_exporter

Prometheus exporter for Windows machines
MIT License
2.88k stars 690 forks source link

windows_system_system_up_time is not getting updated over time #1657

Closed tapasmallickin closed 3 days ago

tapasmallickin commented 4 days ago

Current Behavior

Installed 0.29.1 MSI on Windows 2022 and browsed http://server_ip:9182/metrics. Though rest of the metrics are visible and getting updated, windows_system_system_up_time is stalled on a single value and not getting updated.

Getting following: windows_system_system_up_time 1.7243848375007925e+09

Expected Behavior

windows_system_system_up_time should change over time.

Steps To Reproduce

No response

Environment

windows_exporter logs

ts=2024-09-30T09:29:56.607Z level=info caller=prometheus.go:276 msg="collector system succeeded after 11.2324ms, resulting in 8 metrics"

Anything else?

No response

jkroepke commented 3 days ago

The metric name sounds misleading. It's the unix timestamp of the last boot (https://github.com/prometheus-community/windows_exporter/blob/996080c1e99dbfabac01253c963cf96ea4af9828/docs/collector.system.md?plain=1#L25), To get the uptime, you can query

time() - windows_system_system_up_time