From 8e89ad64f2b9dc7b5659279925467fade279efbd Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:55:45 +0200 Subject: [PATCH 1/2] minio-exporter: remove --- .../prometheus/minio-exporter/default.nix | 36 ---- .../prometheus/minio-exporter/deps.nix | 174 ------------------ pkgs/top-level/aliases.nix | 3 +- pkgs/top-level/all-packages.nix | 1 - 4 files changed, 2 insertions(+), 212 deletions(-) delete mode 100644 pkgs/servers/monitoring/prometheus/minio-exporter/default.nix delete mode 100644 pkgs/servers/monitoring/prometheus/minio-exporter/deps.nix diff --git a/pkgs/servers/monitoring/prometheus/minio-exporter/default.nix b/pkgs/servers/monitoring/prometheus/minio-exporter/default.nix deleted file mode 100644 index 818a8dbb8879..000000000000 --- a/pkgs/servers/monitoring/prometheus/minio-exporter/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ lib, buildGoPackage, fetchFromGitHub, fetchpatch }: - -buildGoPackage rec { - pname = "minio-exporter"; - version = "0.2.0"; - rev = "v${version}"; - - goPackagePath = "github.com/joe-pll/minio-exporter"; - - src= fetchFromGitHub { - inherit rev; - owner = "joe-pll"; - repo = "minio-exporter"; - sha256 = "1my3ii5s479appiapw8gjzkq1pk62fl7d7if8ljvdj6qw4man6aa"; - }; - - # Required to make 0.2.0 build against latest dependencies - # TODO: Remove on update to 0.3.0 - patches = [ - (fetchpatch { - url = "https://github.com/joe-pll/minio-exporter/commit/50ab89d42322dc3e2696326a9ae4d3f951f646de.patch"; - sha256 = "0aiixhvb4x8c8abrlf1i4hmca9i6xd6b638a5vfkvawx0q7gxl97"; - }) - ]; - - goDeps = ./deps.nix; - - meta = with lib; { - description = "Prometheus exporter for Minio cloud storage server"; - mainProgram = "minio-exporter"; - homepage = "https://github.com/joe-pll/minio-exporter"; - license = licenses.asl20; - maintainers = with maintainers; [ bachp ]; - platforms = platforms.unix; - }; -} diff --git a/pkgs/servers/monitoring/prometheus/minio-exporter/deps.nix b/pkgs/servers/monitoring/prometheus/minio-exporter/deps.nix deleted file mode 100644 index 1993975e2bfa..000000000000 --- a/pkgs/servers/monitoring/prometheus/minio-exporter/deps.nix +++ /dev/null @@ -1,174 +0,0 @@ -# This file was generated by https://github.com/kamilchm/go2nix v1.2.1 -[ - { - goPackagePath = "github.com/alecthomas/template"; - fetch = { - type = "git"; - url = "https://github.com/alecthomas/template"; - rev = "a0175ee3bccc567396460bf5acd36800cb10c49c"; - sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj"; - }; - } - { - goPackagePath = "github.com/alecthomas/units"; - fetch = { - type = "git"; - url = "https://github.com/alecthomas/units"; - rev = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a"; - sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl"; - }; - } - { - goPackagePath = "github.com/beorn7/perks"; - fetch = { - type = "git"; - url = "https://github.com/beorn7/perks"; - rev = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"; - sha256 = "1hrybsql68xw57brzj805xx2mghydpdiysv3gbhr7f5wlxj2514y"; - }; - } - { - goPackagePath = "github.com/go-ini/ini"; - fetch = { - type = "git"; - url = "https://github.com/go-ini/ini"; - rev = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a"; - sha256 = "0mhgxw5q6b0pryhikx3k4wby7g32rwjjljzihi47lwn34kw5y1qn"; - }; - } - { - goPackagePath = "github.com/golang/protobuf"; - fetch = { - type = "git"; - url = "https://github.com/golang/protobuf"; - rev = "1e59b77b52bf8e4b449a57e6f79f21226d571845"; - sha256 = "19bkh81wnp6njg3931wky6hsnnl2d1ig20vfjxpv450sd3k6yys8"; - }; - } - { - goPackagePath = "github.com/matttproud/golang_protobuf_extensions"; - fetch = { - type = "git"; - url = "https://github.com/matttproud/golang_protobuf_extensions"; - rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c"; - sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya"; - }; - } - { - goPackagePath = "github.com/minio/minio-go"; - fetch = { - type = "git"; - url = "https://github.com/minio/minio-go"; - rev = "d218e4cb1bfc13dcef0eb5c3e74507a35be0dd3a"; - sha256 = "0d3am33xaavdffz791qi2s0vnkpjw9vlr5p5g4lw7h5vhmy1sjb4"; - }; - } - { - goPackagePath = "github.com/minio/minio"; - fetch = { - type = "git"; - url = "https://github.com/minio/minio"; - rev = "bb73c84b104bc447eb603d63481cdc54b8ab3c83"; - sha256 = "1gjkgdf59yxfr2a7pl3f7z3iid86zsd85xqxcv1s0d46v7j07iga"; - }; - } - { - goPackagePath = "github.com/mitchellh/go-homedir"; - fetch = { - type = "git"; - url = "https://github.com/mitchellh/go-homedir"; - rev = "b8bc1bf767474819792c23f32d8286a45736f1c6"; - sha256 = "13ry4lylalkh4g2vny9cxwvryslzyzwp9r92z0b10idhdq3wad1q"; - }; - } - { - goPackagePath = "github.com/prometheus/client_golang"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/client_golang"; - rev = "06bc6e01f4baf4ee783ffcd23abfcb0b0f9dfada"; - sha256 = "0dvv21214sn702kc25y5l0gd9d11358976d3w31fgwx7456mjx26"; - }; - } - { - goPackagePath = "github.com/prometheus/client_model"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/client_model"; - rev = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"; - sha256 = "19y4ywsivhpxj7ikf2j0gm9k3cmyw37qcbfi78n526jxcc7kw998"; - }; - } - { - goPackagePath = "github.com/prometheus/common"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/common"; - rev = "89604d197083d4781071d3c65855d24ecfb0a563"; - sha256 = "169rdlaf2mk9z4fydz7ajmngyhmf3q1lk96yhvx46bn986x5xkyn"; - }; - } - { - goPackagePath = "github.com/prometheus/procfs"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/procfs"; - rev = "b15cd069a83443be3154b719d0cc9fe8117f09fb"; - sha256 = "1cr45wg2m40bj2za8f32mq09rjlcnk5kfam0h0hr8wcb015k4wxj"; - }; - } - { - goPackagePath = "github.com/sirupsen/logrus"; - fetch = { - type = "git"; - url = "https://github.com/sirupsen/logrus"; - rev = "d682213848ed68c0a260ca37d6dd5ace8423f5ba"; - sha256 = "0nzyqwzx3k7nqfq8q7yv32gaf3ymq3bpwhkmw1hj2zakq5a93d8x"; - }; - } - { - goPackagePath = "golang.org/x/crypto"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/crypto"; - rev = "a6600008915114d9c087fad9f03d75087b1a74df"; - sha256 = "099vyf8133bjwaqcv377d9akam3j5xwamwqrihmjhvzbvqs649yc"; - }; - } - { - goPackagePath = "golang.org/x/net"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/net"; - rev = "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec"; - sha256 = "0bdwdxy2gz48icnh023r5fga3z4x6c8gry8jlfjqr5w12y3s281g"; - }; - } - { - goPackagePath = "golang.org/x/sys"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/sys"; - rev = "2c42eef0765b9837fbdab12011af7830f55f88f0"; - sha256 = "0gj9nwryyzf9rn33gl3zm6rxvg1zhrhwi36akipqj37x4g86h3gz"; - }; - } - { - goPackagePath = "golang.org/x/text"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/text"; - rev = "e19ae1496984b1c655b8044a65c0300a3c878dd3"; - sha256 = "1cvnnx8nwx5c7gr6ajs7sldhbqh52n7h6fsa3i21l2lhx6xrsh4w"; - }; - } - { - goPackagePath = "gopkg.in/alecthomas/kingpin.v2"; - fetch = { - type = "git"; - url = "https://gopkg.in/alecthomas/kingpin.v2"; - rev = "947dcec5ba9c011838740e680966fd7087a71d0d"; - sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r"; - }; - } -] diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 1755693169c2..1051a73588c4 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -891,7 +891,7 @@ mapAliases ({ moonlander = throw "'moonlander' has been removed due to it being broken and unmaintained"; # Added 2023-11-26 moz-phab = mozphab; # Added 2022-08-09 mozart-binary = throw "'mozart-binary' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10 - mozart = throw "'mozart' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10 + mozart = throw "'mozart' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10 mpc_cli = mpc-cli; # moved from top-level 2022-01-24 mpd_clientlib = libmpdclient; # Added 2021-02-11 mpdevil = plattenalbum; # Added 2024-05-22 @@ -1110,6 +1110,7 @@ mapAliases ({ prometheus-dmarc-exporter = dmarc-metrics-exporter; # added 2022-05-31 prometheus-dovecot-exporter = dovecot_exporter; # Added 2024-06-10 prometheus-openvpn-exporter = throw "'prometheus-openvpn-exporter' has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2023-12-23 + prometheus-minio-exporter = throw "'prometheus-minio-exporter' has been removed from nixpkgs, use Minio's built-in Prometheus integration instead"; # Added 2024-06-10 prometheus-speedtest-exporter = throw "prometheus-speedtest-exporter was removed as unmaintained"; # Added 2023-07-31 protobuf3_17 = throw "protobuf3_17 does not receive updates anymore and has been removed"; # Added 2023-05-21 protobuf3_19 = throw "protobuf3_19 does not receive updates anymore and has been removed"; # Added 2023-10-01 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 258041b586ff..29b791a80b37 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26238,7 +26238,6 @@ with pkgs; prometheus-lnd-exporter = callPackage ../servers/monitoring/prometheus/lnd-exporter.nix { }; prometheus-mail-exporter = callPackage ../servers/monitoring/prometheus/mail-exporter.nix { }; prometheus-mikrotik-exporter = callPackage ../servers/monitoring/prometheus/mikrotik-exporter.nix { }; - prometheus-minio-exporter = callPackage ../servers/monitoring/prometheus/minio-exporter { }; prometheus-modemmanager-exporter = callPackage ../servers/monitoring/prometheus/modemmanager-exporter.nix { }; prometheus-mongodb-exporter = callPackage ../servers/monitoring/prometheus/mongodb-exporter.nix { }; prometheus-mysqld-exporter = callPackage ../servers/monitoring/prometheus/mysqld-exporter.nix { }; From 43990c54280c2498d00f39743caae8bbd2f44745 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:55:52 +0200 Subject: [PATCH 2/2] nixos/prometheus: remove minio exporter --- .../manual/release-notes/rl-2411.section.md | 3 + .../monitoring/prometheus/exporters.nix | 19 ++--- .../monitoring/prometheus/exporters/minio.nix | 69 ------------------- pkgs/top-level/aliases.nix | 2 +- 4 files changed, 9 insertions(+), 84 deletions(-) delete mode 100644 nixos/modules/services/monitoring/prometheus/exporters/minio.nix diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 2a979a1e14e7..114dee5b60a6 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -119,6 +119,9 @@ support, which is the intended default behavior by Tracy maintainers. X11 users have to switch to the new package `tracy-x11`. +- The `services.prometheus.exporters.minio` option has been removed, as it's upstream implementation was broken and unmaintained. + Minio now has built-in [Prometheus metrics exposure](https://min.io/docs/minio/linux/operations/monitoring/collect-minio-metrics-using-prometheus.html), which can be used instead. + ## Other Notable Changes {#sec-release-24.11-notable-changes} diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix index 2dc12a221bf0..dc357f6cc5fb 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -52,7 +52,6 @@ let "lnd" "mail" "mikrotik" - "minio" "modemmanager" "mongodb" "mysqld" @@ -279,20 +278,16 @@ let in { - imports = (lib.forEach [ "blackboxExporter" "collectdExporter" "fritzboxExporter" - "jsonExporter" "minioExporter" "nginxExporter" "nodeExporter" - "snmpExporter" "unifiExporter" "varnishExporter" ] - (opt: lib.mkRemovedOptionModule [ "services" "prometheus" "${opt}" ] '' - The prometheus exporters are now configured using `services.prometheus.exporters'. - See the 18.03 release notes for more information. - '' )); - options.services.prometheus.exporters = mkOption { type = types.submodule { options = (mkSubModules); imports = [ ../../../misc/assertions.nix (lib.mkRenamedOptionModule [ "unifi-poller" ] [ "unpoller" ]) + (lib.mkRemovedOptionModule [ "minio" ] '' + The Minio exporter has been removed, as it was broken and unmaintained. + See the 24.11 release notes for more information. + '') ]; }; description = "Prometheus exporter configuration"; @@ -438,11 +433,7 @@ in '' ) ] ++ config.services.prometheus.exporters.warnings; - }] ++ [(mkIf config.services.minio.enable { - services.prometheus.exporters.minio.minioAddress = mkDefault "http://localhost:9000"; - services.prometheus.exporters.minio.minioAccessKey = mkDefault config.services.minio.accessKey; - services.prometheus.exporters.minio.minioAccessSecret = mkDefault config.services.minio.secretKey; - })] ++ [(mkIf config.services.prometheus.exporters.rtl_433.enable { + }] ++ [(mkIf config.services.prometheus.exporters.rtl_433.enable { hardware.rtl-sdr.enable = mkDefault true; })] ++ [(mkIf config.services.postfix.enable { services.prometheus.exporters.postfix.group = mkDefault config.services.postfix.setgidGroup; diff --git a/nixos/modules/services/monitoring/prometheus/exporters/minio.nix b/nixos/modules/services/monitoring/prometheus/exporters/minio.nix deleted file mode 100644 index 8faff5908b8a..000000000000 --- a/nixos/modules/services/monitoring/prometheus/exporters/minio.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ config, lib, pkgs, options, ... }: - -let - cfg = config.services.prometheus.exporters.minio; - inherit (lib) - mkOption - types - optionalString - concatStringsSep - escapeShellArg - ; -in -{ - port = 9290; - extraOpts = { - minioAddress = mkOption { - type = types.str; - example = "https://10.0.0.1:9000"; - description = '' - The URL of the minio server. - Use HTTPS if Minio accepts secure connections only. - By default this connects to the local minio server if enabled. - ''; - }; - - minioAccessKey = mkOption { - type = types.str; - example = "yourMinioAccessKey"; - description = '' - The value of the Minio access key. - It is required in order to connect to the server. - By default this uses the one from the local minio server if enabled - and `config.services.minio.accessKey`. - ''; - }; - - minioAccessSecret = mkOption { - type = types.str; - description = '' - The value of the Minio access secret. - It is required in order to connect to the server. - By default this uses the one from the local minio server if enabled - and `config.services.minio.secretKey`. - ''; - }; - - minioBucketStats = mkOption { - type = types.bool; - default = false; - description = '' - Collect statistics about the buckets and files in buckets. - It requires more computation, use it carefully in case of large buckets.. - ''; - }; - }; - serviceOpts = { - serviceConfig = { - ExecStart = '' - ${pkgs.prometheus-minio-exporter}/bin/minio-exporter \ - -web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ - -minio.server ${cfg.minioAddress} \ - -minio.access-key ${escapeShellArg cfg.minioAccessKey} \ - -minio.access-secret ${escapeShellArg cfg.minioAccessSecret} \ - ${optionalString cfg.minioBucketStats "-minio.bucket-stats"} \ - ${concatStringsSep " \\\n " cfg.extraFlags} - ''; - }; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 1051a73588c4..1642cf371d86 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -891,7 +891,7 @@ mapAliases ({ moonlander = throw "'moonlander' has been removed due to it being broken and unmaintained"; # Added 2023-11-26 moz-phab = mozphab; # Added 2022-08-09 mozart-binary = throw "'mozart-binary' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10 - mozart = throw "'mozart' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10 + mozart = throw "'mozart' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10 mpc_cli = mpc-cli; # moved from top-level 2022-01-24 mpd_clientlib = libmpdclient; # Added 2021-02-11 mpdevil = plattenalbum; # Added 2024-05-22