* [PATCH common 1/1] proc stat: remove unused sum metric
@ 2026-08-20 11:38 Thomas Ellmenreich
0 siblings, 0 replies; only message in thread
From: Thomas Ellmenreich @ 2026-08-20 11:38 UTC (permalink / raw)
To: pve-devel; +Cc: Thomas Ellmenreich
read_proc_stat initializes a 'sum' metric, but never actually sets it
to a value. The metric is also never used, but does end up adding noise
to the displayed metrics.
Signed-off-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
---
metrics server, to answer this: [1] forum question, I noticed that
the OpenTelemetry metric 'proxmox_node_cpustat_sum_ratio' always
remained on '0'. During the investigation, I realized that the value
is initialized, but then never actually assigned to, so I propose it
to be removed.
Grepping through all of our repositories, I could not find any
occurrence where we actually use this 'sum' property on the return
value of 'read_proc_stat'.
During the investigation, I had a Prometheus instance running and
pushed metrics to it by configuring it as an OpenTelemetry metrics
server in a PVE instance. I repeated the same setup with this patch
applied, and the 'proxmox_node_cpustat_sum_ratio' metric has
disappeared as expected.
[1]: https://forum.proxmox.com/threads/questions-about-otel-metrics-listing.184949/#post-866365
src/PVE/ProcFSTools.pm | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index bb8d276..12e0358 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -257,7 +257,6 @@ sub read_proc_stat {
steal => 0,
guest => 0,
guest_nice => 0,
- sum => 0,
};
my $cpucount = 0;
--
2.47.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-20 11:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 11:38 [PATCH common 1/1] proc stat: remove unused sum metric Thomas Ellmenreich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.