From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id DCBDF1FF0B2 for ; Thu, 20 Aug 2026 13:38:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EC8912158B; Thu, 20 Aug 2026 13:38:27 +0200 (CEST) From: Thomas Ellmenreich To: pve-devel@lists.proxmox.com Subject: [PATCH common 1/1] proc stat: remove unused sum metric Date: Thu, 20 Aug 2026 13:38:21 +0200 Message-ID: <20260820113821.153224-1-t.ellmenreich@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787225878394 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.732 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MAJ5BVLEO45CKZLPW26LRMLFYVGTC5MW X-Message-ID-Hash: MAJ5BVLEO45CKZLPW26LRMLFYVGTC5MW X-MailFrom: t.ellmenreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Thomas Ellmenreich X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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