unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Leo Nikkilä" <hello@lnikki.la>
To: 54560@debbugs.gnu.org
Cc: "Leo Nikkilä" <hello@lnikki.la>
Subject: [bug#54560] [PATCH 47/47] gnu: Add go-github-com-prometheus-prometheus.
Date: Fri, 25 Mar 2022 15:32:11 +0200	[thread overview]
Message-ID: <20220325133211.5128-47-hello@lnikki.la> (raw)
In-Reply-To: <20220325133211.5128-1-hello@lnikki.la>

* gnu/packages/patches/go-github-com-prometheus-prometheus-remove-deps.patch:
New patch, reduce go-github-com-prometheus-prometheus dependency tree.
* gnu/packages/monitoring.scm (go-github-com-prometheus-prometheus): New
variable.
---
 gnu/packages/monitoring.scm                   | 83 +++++++++++++++++++
 ...om-prometheus-prometheus-remove-deps.patch | 33 ++++++++
 2 files changed, 116 insertions(+)
 create mode 100644 gnu/packages/patches/go-github-com-prometheus-prometheus-remove-deps.patch

diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index 7935c92815..968eb6b1ee 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2021, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
+;;; Copyright © 2022 Leo Nikkilä <hello@lnikki.la>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,6 +49,7 @@ (define-module (gnu packages monitoring)
   #:use-module (gnu packages django)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages golang)
   #:use-module (gnu packages image)
   #:use-module (gnu packages mail)
   #:use-module (gnu packages ncurses)
@@ -61,6 +63,7 @@ (define-module (gnu packages monitoring)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages rrdtool)
+  #:use-module (gnu packages syncthing)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
@@ -499,6 +502,86 @@ (define-public go-github-com-prometheus-node-exporter
     (home-page "https://github.com/prometheus/node_exporter")
     (license license:asl2.0)))
 
+(define-public go-github-com-prometheus-prometheus
+  (package
+    (name "go-github-com-prometheus-prometheus")
+    (version "2.33.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/prometheus/prometheus")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0arz7ksrfavzg3vm5rlf6y3gbj8l59cg4x4zw6gmmd1dkflm2jx3"))
+              (patches (search-patches
+                        "go-github-com-prometheus-prometheus-remove-deps.patch"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/prometheus/prometheus/cmd/prometheus"
+       #:unpack-path "github.com/prometheus/prometheus"
+       #:install-source? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda* (#:key import-path #:allow-other-keys)
+             ;; `k8s.io/klog' is replaced by `simonpasquier/klog-gokit'
+             (substitute* (find-files (string-append "src/" import-path)
+                                      "\\.go")
+               (("k8s.io/klog/v2") "github.com/simonpasquier/klog-gokit/v3")
+               (("k8s.io/klog") "github.com/simonpasquier/klog-gokit"))
+             #t)))))
+    (native-inputs (list go-github-com-alecthomas-template
+                         go-github-com-alecthomas-units
+                         go-github-com-aws-aws-sdk-go
+                         go-github-com-cespare-xxhash
+                         go-github-com-dennwc-varint
+                         go-github-com-edsrzf-mmap-go
+                         go-github-com-fsnotify-fsnotify
+                         go-github-com-go-kit-log
+                         go-github-com-go-logfmt-logfmt
+                         go-github-com-go-openapi-strfmt
+                         go-github-com-gogo-protobuf
+                         go-github-com-golang-snappy
+                         go-github-com-json-iterator-go
+                         go-github-com-mwitkow-go-conntrack
+                         go-github-com-oklog-run
+                         go-github-com-oklog-ulid
+                         go-github-com-opentracing-contrib-go-stdlib
+                         go-github-com-opentracing-opentracing-go
+                         go-github-com-pkg-errors
+                         go-github-com-prometheus-alertmanager-api
+                         go-github-com-prometheus-client-golang
+                         go-github-com-prometheus-client-model
+                         go-github-com-prometheus-common
+                         go-github-com-prometheus-exporter-toolkit
+                         go-github-com-shurcool-httpfs
+                         go-github-com-shurcool-vfsgen
+                         go-github-com-simonpasquier-klog-gokit
+                         go-github-com-simonpasquier-klog-gokit-v3
+                         go-github-com-stretchr-testify
+                         go-github-com-uber-jaeger-client-go
+                         go-github-com-uber-jaeger-lib
+                         go-go-uber-org-atomic
+                         go-go-uber-org-goleak
+                         go-golang-org-x-net
+                         go-golang-org-x-sync
+                         go-golang-org-x-sys
+                         go-golang-org-x-time
+                         go-golang-org-x-tools
+                         go-gopkg-in-alecthomas-kingpin.v2
+                         go-gopkg-in-yaml-v2
+                         go-gopkg-in-yaml-v3))
+    (synopsis "Monitoring system and time series database")
+    (description
+     "Prometheus is a systems and service monitoring system.  It
+collects metrics from configured targets at given intervals, evaluates
+rule expressions, displays the results, and can trigger alerts when
+specified conditions are observed.")
+    (home-page "https://github.com/prometheus/prometheus")
+    (license license:asl2.0)))
+
 (define-public temper-exporter
   (let ((commit "a87bbab19c05609d62d9e4c7941178700c1ef84d")
         (revision "0"))
diff --git a/gnu/packages/patches/go-github-com-prometheus-prometheus-remove-deps.patch b/gnu/packages/patches/go-github-com-prometheus-prometheus-remove-deps.patch
new file mode 100644
index 0000000000..4d4626d2d1
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-prometheus-prometheus-remove-deps.patch
@@ -0,0 +1,33 @@
+This patch reduces the Prometheus dependency tree, most of which
+consists of unpackaged Go libraries, by removing certain discovery
+plugins.
+
+diff --git a/discovery/install/install.go b/discovery/install/install.go
+index e16b348f6..a3944cf9f 100644
+--- a/discovery/install/install.go
++++ b/discovery/install/install.go
+@@ -17,24 +17,9 @@ package install
+ 
+ import (
+-	_ "github.com/prometheus/prometheus/discovery/aws"          // register aws
+-	_ "github.com/prometheus/prometheus/discovery/azure"        // register azure
+-	_ "github.com/prometheus/prometheus/discovery/consul"       // register consul
+-	_ "github.com/prometheus/prometheus/discovery/digitalocean" // register digitalocean
+-	_ "github.com/prometheus/prometheus/discovery/dns"          // register dns
+ 	_ "github.com/prometheus/prometheus/discovery/eureka"       // register eureka
+ 	_ "github.com/prometheus/prometheus/discovery/file"         // register file
+-	_ "github.com/prometheus/prometheus/discovery/gce"          // register gce
+-	_ "github.com/prometheus/prometheus/discovery/hetzner"      // register hetzner
+ 	_ "github.com/prometheus/prometheus/discovery/http"         // register http
+-	_ "github.com/prometheus/prometheus/discovery/kubernetes"   // register kubernetes
+-	_ "github.com/prometheus/prometheus/discovery/linode"       // register linode
+ 	_ "github.com/prometheus/prometheus/discovery/marathon"     // register marathon
+-	_ "github.com/prometheus/prometheus/discovery/moby"         // register moby
+-	_ "github.com/prometheus/prometheus/discovery/openstack"    // register openstack
+ 	_ "github.com/prometheus/prometheus/discovery/puppetdb"     // register puppetdb
+-	_ "github.com/prometheus/prometheus/discovery/scaleway"     // register scaleway
+ 	_ "github.com/prometheus/prometheus/discovery/triton"       // register triton
+-	_ "github.com/prometheus/prometheus/discovery/uyuni"        // register uyuni
+-	_ "github.com/prometheus/prometheus/discovery/xds"          // register xds
+-	_ "github.com/prometheus/prometheus/discovery/zookeeper"    // register zookeeper
+ )
-- 
2.34.0





  parent reply	other threads:[~2022-03-25 14:21 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  5:55 [bug#54560] [PATCH 00/47] gnu: Add go-github-com-prometheus-prometheus Leo Nikkilä
2022-03-25 13:31 ` [bug#54560] [PATCH 01/47] gnu: Add go-google-golang-org-protobuf Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 02/47] gnu: go-github-com-golang-protobuf-proto: Update to 1.5.2 Leo Nikkilä
2022-03-25 19:12     ` Maxime Devos
2022-03-25 22:55       ` Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 03/47] gnu: Add go-github-com-golang-protobuf-ptypes Leo Nikkilä
2022-03-25 19:14     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 04/47] gnu: go-github-com-prometheus-client-golang: Update to 1.12.1 Leo Nikkilä
2022-03-25 19:19     ` Maxime Devos
2022-03-25 19:20     ` Maxime Devos
2022-03-25 19:22     ` Maxime Devos
2022-03-25 19:23     ` Maxime Devos
2022-03-25 19:24     ` Maxime Devos
2022-03-25 22:55       ` Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 05/47] gnu: Add go-github-com-asaskevich-govalidator Leo Nikkilä
2022-03-25 19:26     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 06/47] gnu: Add go-github-com-dennwc-varint Leo Nikkilä
2022-03-25 19:30     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 07/47] gnu: Add go-github-com-edsrzf-mmap-go Leo Nikkilä
2022-03-25 19:33     ` Maxime Devos
2022-03-25 19:35     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 08/47] gnu: Add go-github-com-go-logfmt-logfmt Leo Nikkilä
2022-03-25 19:38     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 09/47] gnu: Add go-github-com-go-kit-log Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 10/47] gnu: Add go-github-com-go-stack-stack Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 11/47] gnu: Add go-github-com-josharian-intern Leo Nikkilä
2022-03-25 19:40     ` Maxime Devos
2022-03-25 19:41     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 12/47] gnu: Add go-github-com-julienschmidt-httprouter Leo Nikkilä
2022-03-25 19:47     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 13/47] gnu: Add go-github-com-mailru-easyjson Leo Nikkilä
2022-03-25 19:49     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 14/47] gnu: Add go-github-com-modern-go-concurrent Leo Nikkilä
2022-03-25 19:50     ` Maxime Devos
2022-03-25 19:51     ` Maxime Devos
2022-03-25 13:31   ` [bug#54560] [PATCH 15/47] gnu: Add go-github-com-modern-go-reflect2 Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 16/47] gnu: Add go-github-com-montanaflynn-stats Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 17/47] gnu: Add go-github-com-mwitkow-go-conntrack Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 18/47] gnu: Add go-github-com-oklog-run Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 19/47] gnu: Add go-github-com-oklog-ulid Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 20/47] gnu: Add go-github-com-opentracing-contrib-go-stdlib Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 21/47] gnu: Add go-github-com-puerkitobio-urlesc Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 22/47] gnu: Add go-github-com-puerkitobio-purell Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 23/47] gnu: Add go-github-com-shurcool-httpgzip Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 24/47] gnu: Add go-github-com-shurcool-httpfs Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 25/47] gnu: Add go-github-com-shurcool-vfsgen Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 26/47] gnu: Add go-github-com-simonpasquier-klog-gokit Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 27/47] gnu: Add go-github-com-simonpasquier-klog-gokit-v3 Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 28/47] gnu: Add go-github-com-tidwall-pretty Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 29/47] gnu: Add go-github-com-uber-jaeger-lib Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 30/47] gnu: Add go-github-com-uber-jaeger-client-go Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 31/47] gnu: Add go-github-com-youmark-pkcs8 Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 32/47] gnu: Add go-go-uber-org-goleak Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 33/47] gnu: Add go-gopkg-in-alecthomas-kingpin.v2 Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 34/47] gnu: Add go-github-com-json-iterator-go Leo Nikkilä
2022-03-25 13:31   ` [bug#54560] [PATCH 35/47] gnu: Add go-go-mongodb-org-mongo-driver Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 36/47] gnu: Add go-github-com-go-openapi-errors Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 37/47] gnu: Add go-github-com-go-openapi-swag Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 38/47] gnu: Add go-github-com-go-openapi-jsonpointer Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 39/47] gnu: Add go-github-com-go-openapi-jsonreference Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 40/47] gnu: Add go-github-com-go-openapi-spec Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 41/47] gnu: Add go-github-com-go-openapi-strfmt Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 42/47] gnu: Add go-github-com-go-openapi-analysis Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 43/47] gnu: Add go-github-com-go-openapi-loads Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 44/47] gnu: Add go-github-com-go-openapi-validate Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 45/47] gnu: Add go-github-com-prometheus-alertmanager-api Leo Nikkilä
2022-03-25 13:32   ` [bug#54560] [PATCH 46/47] gnu: Add go-github-com-prometheus-exporter-toolkit Leo Nikkilä
2022-03-25 19:52     ` Maxime Devos
2022-03-25 22:55       ` Leo Nikkilä
2022-03-25 13:32   ` Leo Nikkilä [this message]
2022-03-25 20:04     ` [bug#54560] [PATCH 47/47] gnu: Add go-github-com-prometheus-prometheus Maxime Devos
2022-03-25 20:05     ` Maxime Devos
2022-03-25 22:55       ` Leo Nikkilä
2022-03-25 19:09   ` [bug#54560] [PATCH 01/47] gnu: Add go-google-golang-org-protobuf Maxime Devos
2022-03-25 19:15   ` Maxime Devos
2022-03-25 22:55     ` Leo Nikkilä
2022-03-26  9:31       ` Maxime Devos
2022-03-25 19:55 ` [bug#54560] [PATCH 00/47] gnu: Add go-github-com-prometheus-prometheus Maxime Devos
2022-03-25 19:59 ` Maxime Devos
2022-03-25 22:53   ` Leo Nikkilä
2022-03-26  9:18     ` Maxime Devos
2022-03-26  9:36     ` Maxime Devos
2024-05-23 15:20 ` Sharlatan Hellseher

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=20220325133211.5128-47-hello@lnikki.la \
    --to=hello@lnikki.la \
    --cc=54560@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).