From 57a3e84ceccabda9cd22868ef203a1ba96ce247d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 3 Dec 2024 18:31:41 +0100 Subject: [PATCH] process: fix metric labels for multiple process instances (#1804) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- internal/collector/process/process.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/collector/process/process.go b/internal/collector/process/process.go index a8ef4b3b..24aec904 100644 --- a/internal/collector/process/process.go +++ b/internal/collector/process/process.go @@ -362,7 +362,8 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error { for name, process := range perfData { // Duplicate processes are suffixed #, and an index number. Remove those. - name, _, _ = strings.Cut(name, ":") + name, _, _ = strings.Cut(name, ":") // Process V2 + name, _, _ = strings.Cut(name, "#") // Process if c.config.ProcessExclude.MatchString(name) || !c.config.ProcessInclude.MatchString(name) { continue