summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-04-20 22:17:40 +0100
committerGuix Patches Tester <>2020-04-20 22:20:06 +0100
commita87785d3f8c475d6a0f9d2910639587938450ddb (patch)
treea9c6d0b9509d360ca86079bf3ceedd90a3a27a26
parentb023a8acd38b57b159aeeef0ac6de73960f97e8b (diff)
downloadpatches-a87785d3f8c475d6a0f9d2910639587938450ddb.tar
patches-a87785d3f8c475d6a0f9d2910639587938450ddb.tar.gz
gnu: Add prometheus.
* gnu/packages/monitoring.scm (prometheus): New variable.
-rw-r--r--gnu/packages/monitoring.scm49
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index 8da31d6a84..345c2c16c5 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -422,6 +422,55 @@ written in Go with pluggable metric collectors.")
(home-page "https://github.com/prometheus/node_exporter")
(license license:asl2.0)))
+(define-public prometheus
+ (package
+ (name "prometheus")
+ (version "2.17.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/prometheus/prometheus.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1r7zpq6647lrm7cmid6nnf2xnljqh1i9g0fxvs0qrfd2sxxgj0c7"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:unpack-path "github.com/prometheus/prometheus"
+ #:import-path "github.com/prometheus/prometheus/cmd/prometheus"
+ #:install-source? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (assets-prefix
+ (string-append out "/var/lib/prometheus/assets")))
+ (substitute* "src/github.com/prometheus/prometheus/web/ui/ui.go"
+ (("var assetsPrefix string")
+ (string-append "var assetsPrefix string = \""
+ assets-prefix
+ "\""))))
+ #t))
+ (add-after 'install 'install-assets
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (assets-prefix
+ (string-append out "/var/lib/prometheus/assets")))
+ (for-each (lambda (directory)
+ (copy-recursively
+ (string-append "src/github.com/prometheus/prometheus"
+ "/web/ui/" directory)
+ (string-append assets-prefix
+ "/" directory)))
+ '("static" "templates")))
+ #t)))))
+ (home-page "https://prometheus.io/")
+ (synopsis "")
+ (description "")
+ (license "")))
+
(define-public fswatch
(package
(name "fswatch")