From 2aebd5c2da0d3f91e7dafd7993a8f14ed81ea3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 3 Dec 2024 12:07:03 +0100 Subject: [PATCH] process: fix metric labels for multiple process instances (#1803) 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/collector/process/process.go b/internal/collector/process/process.go index 7d182b41..a8ef4b3b 100644 --- a/internal/collector/process/process.go +++ b/internal/collector/process/process.go @@ -362,7 +362,7 @@ 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, ":") if c.config.ProcessExclude.MatchString(name) || !c.config.ProcessInclude.MatchString(name) { continue