client_golang
client_golang copied to clipboard
Add option to include child processes in process collector
The NewProcessCollector currently only looks at one PID.
It would be useful to have a boolean flag that would allow aggregating some of the metrics. This would be useful for creating exporters for things that spawn un-privileged workers from a main PID.
For example, haproxy, postfix, apache, etc.
To be debated, how to handle the labels/aggregations here.
Yeah, aggregations will be problematic for some metrics.
How about just calling NewProcessCollector n-times and register it via a label-wrapped registry using https://pkg.go.dev/github.com/prometheus/client_golang/[email protected]?tab=doc#WrapRegistererWith ?
Yes, that may be an option. I'd have to think about how to deal with changing child PIDs.