mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-26 16:32:05 +00:00
process: fix metric labels for multiple process instances (#1804)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
parent
2aebd5c2da
commit
57a3e84cec
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user