Skip to content

Commit

Permalink
Add multiple listeners and systemd socket listener activation (promet…
Browse files Browse the repository at this point in the history
…heus#2393)

Update exporter-toolkit to v0.8.1 to enable new listener support.

Signed-off-by: Perry Naseck <git@perrynaseck.com>
  • Loading branch information
DaAwesomeP authored and oblitorum committed Apr 9, 2024
1 parent 7d193b9 commit 5f82c4c
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/systemd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

If you are using distribution packages or the copr repository, you don't need to deal with these files!

The unit file in this directory is to be put into `/etc/systemd/system`.
The unit files (`*.service` and `*.socket`) in this directory are to be put into `/etc/systemd/system`.
It needs a user named `node_exporter`, whose shell should be `/sbin/nologin` and should not have any special privileges.
It needs a sysconfig file in `/etc/sysconfig/node_exporter`.
It needs a directory named `/var/lib/node_exporter/textfile_collector`, whose owner should be `node_exporter`:`node_exporter`.
Expand Down
3 changes: 2 additions & 1 deletion examples/systemd/node_exporter.service
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[Unit]
Description=Node Exporter
Requires=node_exporter.socket

[Service]
User=node_exporter
EnvironmentFile=/etc/sysconfig/node_exporter
ExecStart=/usr/sbin/node_exporter $OPTIONS
ExecStart=/usr/sbin/node_exporter --web.systemd-socket $OPTIONS

[Install]
WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions examples/systemd/node_exporter.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=Node Exporter

[Socket]
ListenStream=9100

[Install]
WantedBy=sockets.target
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.37.0
github.com/prometheus/exporter-toolkit v0.7.1
github.com/prometheus/exporter-toolkit v0.8.1
github.com/prometheus/procfs v0.8.0
github.com/safchain/ethtool v0.2.0
github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a
Expand All @@ -33,7 +33,7 @@ require (

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -46,16 +46,16 @@ require (
github.com/mdlayher/genetlink v1.2.0 // indirect
github.com/mdlayher/socket v0.2.3 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/net v0.0.0-20220923203811-8be639271d50 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 5f82c4c

Please sign in to comment.