client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Add option to include child processes in process collector

Open SuperQ opened this issue 5 years ago • 2 comments

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.

SuperQ avatar May 25 '20 09:05 SuperQ

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 ?

beorn7 avatar May 26 '20 15:05 beorn7

Yes, that may be an option. I'd have to think about how to deal with changing child PIDs.

SuperQ avatar May 26 '20 21:05 SuperQ