public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Subject: [PATCH common 1/1] proc stat: remove unused sum metric
Date: Thu, 20 Aug 2026 13:38:21 +0200	[thread overview]
Message-ID: <20260820113821.153224-1-t.ellmenreich@proxmox.com> (raw)

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





                 reply	other threads:[~2026-08-20 11:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260820113821.153224-1-t.ellmenreich@proxmox.com \
    --to=t.ellmenreich@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal