Node Exporter : How to obtain Process level metrics

11,652 views
Skip to first unread message

Ashish Jain

unread,
Aug 2, 2016, 5:23:22 AM8/2/16
to Prometheus Developers
Hello,

How can I get process level metrics using Node Exporter? For example CPU usage by process X, memory usage by process Y etc.

Regards
Ashish

Björn Rabenstein

unread,
Aug 2, 2016, 5:39:43 AM8/2/16
to Ashish Jain, Prometheus Developers
On 2 August 2016 at 11:23, Ashish Jain <jain.a...@gmail.com> wrote:
> How can I get process level metrics using Node Exporter? For example CPU
> usage by process X, memory usage by process Y etc.

Process metrics should be exposed by the process itself. The client
libraries have that built in. The metrics start with `process_…`.
Per-process metrics via Node Exporter could end up badly in many ways.

--
Björn Rabenstein, Engineer
http://soundcloud.com/brabenstein

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany
Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B

Fabian Reinartz

unread,
Aug 2, 2016, 9:35:21 AM8/2/16
to Björn Rabenstein, Ashish Jain, Prometheus Developers
Ironically, cAdvisor basically exposes process-level metrics.
In general one could think about a generic process metric exporter. But it shouldn't expose metrics on arbitrary processes as this can generate a very high number of irrelevant metrics. It certainly is not in the scope of a node exporter.

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Björn Rabenstein

unread,
Aug 2, 2016, 10:06:43 AM8/2/16
to Fabian Reinartz, Ashish Jain, Prometheus Developers
On 2 August 2016 at 15:35, Fabian Reinartz <fab.re...@gmail.com> wrote:
> Ironically, cAdvisor basically exposes process-level metrics.

Which, to stay consistent, already caused trouble for some.

wyu...@gmail.com

unread,
Aug 2, 2016, 10:00:54 PM8/2/16
to Prometheus Developers, fab.re...@gmail.com, jain.a...@gmail.com
Hi

This is an interesting topic.

Although I think something similar, I conclude that to expose metrics on arbitrary processes is not necessary.

I agree with Fabian and Björn.

Instead of it, in my use case, I create exporter to expose metrics on specified process.

For example, because I want to monitor fluentd cpu usage, I create fluentd_exporter(https://github.com/wyukawa/fluentd_exporter)

fluentd is a log collector written in ruby.

Fluentd is required to execute in multi process because of GVL(Giant VM Lock)
So, I want to check process level metrics.

But maybe such kind of use case is not common.

Thanks
Wataru Yukawa

Tobias Schmidt

unread,
Aug 2, 2016, 11:29:16 PM8/2/16
to wyu...@gmail.com, Prometheus Developers, Fabian Reinartz, jain.a...@gmail.com
The golang process collector allows to collect metrics for any given
process [0]. This is for example used by the HAProxy exporter [1]. It
does not support the case of forking processes. One would need to
start one collector per pid.

The golang implementation only supports procfs / linux systems. The
ruby client doesn't support process metrics yet. I created [2] for
that.

[0]: https://github.com/prometheus/client_golang/blob/master/prometheus/process_collector.go#L38-L46
[1]: https://github.com/prometheus/haproxy_exporter/blob/master/haproxy_exporter.go#L469-L483
[2]: https://github.com/prometheus/client_golang/blob/master/prometheus/process_collector.go

Ashish Jain

unread,
Aug 4, 2016, 9:42:23 AM8/4/16
to Prometheus Developers, wyu...@gmail.com, fab.re...@gmail.com, jain.a...@gmail.com

Thanks, looks like there are multiple options to look into, will get back once I evaluate each one of those.

Regards
Ashish
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.

nick.c...@gmail.com

unread,
Aug 8, 2016, 10:00:00 AM8/8/16
to Prometheus Developers, wyu...@gmail.com, fab.re...@gmail.com, jain.a...@gmail.com
Two other options: (1) use scollector (http://bosun.org/scollector/process-monitoring) in conjunction with https://github.com/tgulacsi/prometheus_scollector;
or (2) use my own process-exporter (https://github.com/ncabatoff/process-exporter). FYI I consider process-exporter alpha (and it has no tests.)
> > To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages