From: Christopher Baines <mail@cbaines.net>
To: 44922@debbugs.gnu.org
Subject: [bug#44922] [PATCH 6/6] monitoring: Support extra options for the Prometheus node exporter.
Date: Sat, 28 Nov 2020 12:11:49 +0000 [thread overview]
Message-ID: <20201128121149.18639-6-mail@cbaines.net> (raw)
In-Reply-To: <20201128121149.18639-1-mail@cbaines.net>
There are plenty of options supported that the Guix configuration record
doesn't help you with, so add this field to allow users to do their own thing.
* gnu/services/monitoring.scm (<prometheus-node-exporter-configuration>): Add
extra-options field.
(prometheus-node-exporter-shepherd-service): Handle the extra options.
* doc/guix.texi (Prometheus Node Exporter Service): Document this.
---
doc/guix.texi | 3 +++
gnu/services/monitoring.scm | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6cd65b8739..dc624d89ec 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -21918,6 +21918,9 @@ This directory can be used to export metrics specific to this machine.
Files containing metrics in the text format, with the filename ending in
@code{.prom} should be placed in this directory.
+@item @code{extra-options} (default: @code{'()})
+Extra options to pass to the Prometheus node exporter.
+
@end table
@end deftp
diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm
index c4bae229b8..4b6f8ed623 100644
--- a/gnu/services/monitoring.scm
+++ b/gnu/services/monitoring.scm
@@ -128,7 +128,9 @@ HTTP.")
(web-listen-address prometheus-node-exporter-web-listen-address
(default ":9100"))
(textfile-directory prometheus-node-exporter-textfile-directory
- (default "/var/lib/prometheus/node-exporter")))
+ (default "/var/lib/prometheus/node-exporter"))
+ (extra-options prometheus-node-exporter-extra-options
+ (default '())))
(define %prometheus-node-exporter-accounts
(list (user-account
@@ -145,7 +147,7 @@ HTTP.")
(define prometheus-node-exporter-shepherd-service
(match-lambda
(( $ <prometheus-node-exporter-configuration>
- package web-listen-address textfile-directory)
+ package web-listen-address textfile-directory extra-options)
(list
(shepherd-service
(documentation "Prometheus node exporter.")
@@ -157,7 +159,8 @@ HTTP.")
#$@(if textfile-directory
(list "--collector.textfile.directory"
textfile-directory)
- '()))
+ '())
+ #$@extra-options)
#:user "prometheus-node-exporter"
#:group "prometheus-node-exporter"
#:log-file "/var/log/prometheus-node-exporter.log"))
--
2.29.2
next prev parent reply other threads:[~2020-11-28 12:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-28 12:04 [bug#44922] [PATCH 0/6] Prometheus node exporter service enhancements Christopher Baines
2020-11-28 12:11 ` [bug#44922] [PATCH 1/6] services: monitoring: Neaten up the Prometheus node exporter Christopher Baines
2020-11-28 12:11 ` [bug#44922] [PATCH 2/6] monitoring: Add user and group for " Christopher Baines
2020-11-28 12:11 ` [bug#44922] [PATCH 3/6] services: monitoring: Use a log file for " Christopher Baines
2020-11-28 12:11 ` [bug#44922] [PATCH 4/6] doc: Remove redundant node exporter configuration from the example Christopher Baines
2020-11-28 12:11 ` [bug#44922] [PATCH 5/6] monitoring: Enable the Prometheus node exporter textfile collector Christopher Baines
2020-11-28 12:11 ` Christopher Baines [this message]
2020-12-06 22:27 ` [bug#44922] [PATCH 0/6] Prometheus node exporter service enhancements Ludovic Courtès
2020-12-07 9:22 ` bug#44922: " Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201128121149.18639-6-mail@cbaines.net \
--to=mail@cbaines.net \
--cc=44922@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).