aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-04-18 14:51:02 +0100
committerChristopher Baines <mail@cbaines.net>2021-07-02 13:55:28 +0100
commitd3683b4780aaae67ec08be9d28a0ebc3f5c80776 (patch)
treeb8349a819527baf3b5b1cb9f4e43145ebfe97ebc
parenta54e086fada6bfc078254a727beb323cc9ff1560 (diff)
downloadguix-d3683b4780aaae67ec08be9d28a0ebc3f5c80776.tar
guix-d3683b4780aaae67ec08be9d28a0ebc3f5c80776.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 d2aef0eaab..cf1a76de6a 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -556,6 +556,55 @@ written in Go with pluggable metric collectors.")
devices.")
(license license:expat))))
+(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")