Prometheus - how to get systemd service level open/max fds limits?

38 views
Skip to first unread message

rs vas

unread,
Mar 26, 2020, 8:47:44 PM3/26/20
to Prometheus Users
Hello, I see node exporter exposed below metric for the file descriptors limits, but these are specific node exporter systemd service level limits.
process_max_fds 1024
process_open_fds 100

I have another systemd proces running on the same aws ec2 instance, for example xyz-service, it has it's limits set. But how to expose these limits to Prometheus? Appreciate your input!

rs vas

unread,
Mar 27, 2020, 12:10:18 PM3/27/20
to Prometheus Users
I was thinking one way could be use the textfile collector and expose those metrics through node exporter? Not sure before going through that route if there is anything Promethes exporters offer out-of-the-box?

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/779c4553-f711-4dbe-930c-ce7ff85b0ca6%40googlegroups.com.

Brian Candler

unread,
Mar 27, 2020, 12:22:10 PM3/27/20
to Prometheus Users
https://github.com/prometheus/node_exporter#disabled-by-default

There is a systemd collector (disabled by default) which "Exposes service and system status from systemd" - but it doesn't appear to have metrics for the cgroup limits.

You can either extend it in go, or use textfile_collector as you said.

rs vas

unread,
Mar 27, 2020, 12:31:17 PM3/27/20
to Brian Candler, Prometheus Users
Thanks Brian for the input! Yes, tried systemd collector but did not see the limits exposed through that collector.

For now quick way to do this is through text collector through Node exporter.

Please share if anyone has any ideas.... Thanks again!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.

Christian Hoffmann

unread,
Mar 27, 2020, 5:29:24 PM3/27/20
to rs vas, Brian Candler, Prometheus Users
Hi,

On 3/27/20 5:30 PM, rs vas wrote:
> Thanks Brian for the input! Yes, tried systemd collector but did not see
> the limits exposed through that collector.
Pretty sure the ncabatoff's process_exporter exposes such metrics:
https://github.com/ncabatoff/process-exporter/

However, there is no direct linking to systemd in this case, although
you can try to use data from both sources in the same PromQL query if
needed.

There also seem to be specialized systemd_exporters, although I don't
have any experience with them, e.g.:
https://github.com/povilasv/systemd_exporter

This one seems to expose systemd_process_open_fds (if enabled).


Kind regards,
Christian

>
> For now quick way to do this is through text collector through Node
> exporter.
>
> Please share if anyone has any ideas.... Thanks again!
>
> On Fri, Mar 27, 2020 at 9:22 AM Brian Candler <b.ca...@pobox.com
> <mailto:b.ca...@pobox.com>> wrote:
>
> https://github.com/prometheus/node_exporter#disabled-by-default
>
> There is a systemd collector (disabled by default) which "Exposes
> service and system status from systemd" - but it doesn't appear to
> have metrics for the cgroup limits.
>
> You can either extend it in go, or use textfile_collector as you said.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to prometheus-use...@googlegroups.com
> <mailto:prometheus-use...@googlegroups.com>.
> <https://groups.google.com/d/msgid/prometheus-users/c926dc71-e860-49ef-af30-909dad5be204%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to prometheus-use...@googlegroups.com
> <mailto:prometheus-use...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CAPs_Afgn4o7fxLN7UnekVSH14S%2Bx4DbeqHdB7yFO39RwPwODBA%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAPs_Afgn4o7fxLN7UnekVSH14S%2Bx4DbeqHdB7yFO39RwPwODBA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages