Node exporter systemd summary feature

619 views
Skip to first unread message

shan...@pandora.com

unread,
Dec 19, 2017, 6:33:30 PM12/19/17
to Prometheus Developers
Hello,

I worked on adding a summary feature to the systemd node exporter: https://github.com/prometheus/node_exporter/compare/master...sevagh:feat/systemd_summary

You can view the diff there. As per CONTRIBUTING.md, I made a topic here first before opening the pull request.

The gist is that using the systemd exporter just outputs thousands and thousands of metrics. We prefer simplified metrics, a summary of the number of systemd services in each state:

```
# HELP node_systemd_unit_state_summary Summary of systemd unit states
# TYPE node_systemd_unit_state_summary gauge
node_systemd_unit_state_summary{state="activating"} 0
node_systemd_unit_state_summary{state="active"} 275
node_systemd_unit_state_summary{state="deactivating"} 0
node_systemd_unit_state_summary{state="failed"} 0
node_systemd_unit_state_summary{state="inactive"} 70
node_systemd_unit_state_summary{state="total"} 345
```

This mode is activated by running `./node_exporter --collector.systemd --collector.systemd.summary`.

Does this feature make sense? Should I open the pull request?

Thanks,
Sevag

Ben Kochie

unread,
Dec 20, 2017, 7:47:33 AM12/20/17
to shan...@pandora.com, Prometheus Developers
This seems useful to me.

I would suggest using the metric name `node_systemd_units`

You should also drop the `total` label, as this is represented by the query `sum(node_systemd_units)`

It's also OK to make this kind of feature request via the github issue tracker. :-)


--
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-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/b44a43b4-82c0-4d5c-85b8-fc6a0a8078c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Kochie

unread,
Dec 20, 2017, 7:49:21 AM12/20/17
to shan...@pandora.com, Prometheus Developers
Oh, one more thing, for the flags,  It would maybe be useful to make this a separate collector, rather than be part of the normal systemd collector.

--collector.systemd-summary

On Wed, Dec 20, 2017 at 1:47 PM, Ben Kochie <sup...@gmail.com> wrote:
This seems useful to me.

I would suggest using the metric name `node_systemd_units`

You should also drop the `total` label, as this is represented by the query `sum(node_systemd_units)`

It's also OK to make this kind of feature request via the github issue tracker. :-)
On Wed, Dec 20, 2017 at 12:33 AM, <shan...@pandora.com> wrote:
Hello,

I worked on adding a summary feature to the systemd node exporter: https://github.com/prometheus/node_exporter/compare/master...sevagh:feat/systemd_summary

You can view the diff there. As per CONTRIBUTING.md, I made a topic here first before opening the pull request.

The gist is that using the systemd exporter just outputs thousands and thousands of metrics. We prefer simplified metrics, a summary of the number of systemd services in each state:

```
# HELP node_systemd_unit_state_summary Summary of systemd unit states
# TYPE node_systemd_unit_state_summary gauge
node_systemd_unit_state_summary{state="activating"} 0
node_systemd_unit_state_summary{state="active"} 275
node_systemd_unit_state_summary{state="deactivating"} 0
node_systemd_unit_state_summary{state="failed"} 0
node_systemd_unit_state_summary{state="inactive"} 70
node_systemd_unit_state_summary{state="total"} 345
```

This mode is activated by running `./node_exporter --collector.systemd --collector.systemd.summary`.

Does this feature make sense? Should I open the pull request?

Thanks,
Sevag

--
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-developers+unsubscri...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages