guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/06: prometheus-node-exporter: Support extra options.


From: guix-commits
Subject: 06/06: prometheus-node-exporter: Support extra options.
Date: Mon, 7 Dec 2020 04:14:36 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit 92f7c11af26580a7e6543efa94531652f187923a
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sat Nov 28 11:03:19 2020 +0000

    prometheus-node-exporter: Support extra options.
    
    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 13e0dcf..a4386ad 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -22043,6 +22043,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 a7fd432..5123a8c 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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]