process: fix metric labels for multiple process instances (#1803)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-12-03 12:07:03 +01:00
committed by GitHub
parent 109c34f572
commit 2aebd5c2da

View File

@@ -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