diff options
author | Christopher Baines <mail@cbaines.net> | 2020-04-18 14:51:02 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-12-19 10:42:26 +0000 |
commit | 54f6ce4b6cfe94c55f15b2534c9a08ba314c68b5 (patch) | |
tree | bc8132475f3c2f896835a4ec1a34dc8b964f8731 /gnu/packages | |
parent | acaa73a702a23e23c1f395bb314e2bcfeb0cc920 (diff) | |
download | guix-54f6ce4b6cfe94c55f15b2534c9a08ba314c68b5.tar guix-54f6ce4b6cfe94c55f15b2534c9a08ba314c68b5.tar.gz |
gnu: Add prometheus.
* gnu/packages/monitoring.scm (prometheus): New variable.
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/monitoring.scm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm index 7dd30f9a6e..3fc0505c9f 100644 --- a/gnu/packages/monitoring.scm +++ b/gnu/packages/monitoring.scm @@ -587,6 +587,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 license:asl2.0))) + (define-public fswatch (package (name "fswatch") |