diff --git a/pkgs/development/go-modules/libs.json b/pkgs/development/go-modules/libs.json index 8ac830e9c8d5..deec3354f97b 100644 --- a/pkgs/development/go-modules/libs.json +++ b/pkgs/development/go-modules/libs.json @@ -1213,5 +1213,14 @@ "rev": "fb7299726d2e68745a8805b14f2ff44b5c2cfa84", "sha256": "185af0x475hq2wmm2zdvxjyslkplf8zzqijdxa937zqxq63qiw4w" } + }, + { + "goPackagePath": "github.com/prometheus/log", + "fetch": { + "type": "git", + "url": "https://github.com/prometheus/log", + "rev": "439e5db48fbb50ebbaf2c816030473a62f505f55", + "sha256": "1fl23gsw2hn3c1y91qckr661sybqcw2gqnd1gllxn3hp6p2w6hxv" + } } ] diff --git a/pkgs/servers/monitoring/prometheus/nginx-exporter.nix b/pkgs/servers/monitoring/prometheus/nginx-exporter.nix new file mode 100644 index 000000000000..5da457c0a190 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/nginx-exporter.nix @@ -0,0 +1,28 @@ +# This file was generated by go2nix. +{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +with goPackages; + +buildGoPackage rec { + name = "nginx_exporter-${version}"; + version = "20160524-${stdenv.lib.strings.substring 0 7 rev}"; + rev = "2cf16441591f6b6e58a8c0439dcaf344057aea2b"; + + goPackagePath = "github.com/discordianfish/nginx_exporter"; + + src = fetchgit { + inherit rev; + url = "https://github.com/discordianfish/nginx_exporter"; + sha256 = "0p9j0bbr2lr734980x2p8d67lcify21glwc5k3i3j4ri4vadpxvc"; + }; + + goDeps = ./nginx-exporter_deps.json; + + meta = with stdenv.lib; { + description = "Metrics relay from nginx stats to Prometheus"; + homepage = https://github.com/discordianfish/nginx_exporter; + license = licenses.asl20; + maintainers = with maintainers; [ benley ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/servers/monitoring/prometheus/nginx-exporter_deps.json b/pkgs/servers/monitoring/prometheus/nginx-exporter_deps.json new file mode 100644 index 000000000000..c7a2b3d1f6c6 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/nginx-exporter_deps.json @@ -0,0 +1,16 @@ +[ + { + "include": "../../libs.json", + "packages": [ + "github.com/prometheus/log", + "github.com/prometheus/client_golang", + "github.com/prometheus/client_model", + "github.com/prometheus/procfs", + "github.com/Sirupsen/logrus", + "github.com/beorn7/perks", + "github.com/golang/protobuf", + "github.com/matttproud/golang_protobuf_extensions", + "bitbucket.org/ww/goautoneg" + ] + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8dfa3d490c10..2f491659d08b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10185,7 +10185,7 @@ in prometheus-haproxy-exporter = callPackage ../servers/monitoring/prometheus/haproxy-exporter.nix { }; prometheus-mesos-exporter = callPackage ../servers/monitoring/prometheus/mesos-exporter.nix { }; prometheus-mysqld-exporter = callPackage ../servers/monitoring/prometheus/mysqld-exporter.nix { }; - prometheus-nginx-exporter = goPackages.prometheus.nginx-exporter.bin // { outputs = [ "bin" ]; }; + prometheus-nginx-exporter = callPackage ../servers/monitoring/prometheus/nginx-exporter.nix { }; prometheus-node-exporter = goPackages.prometheus.node-exporter.bin // { outputs = [ "bin" ]; }; prometheus-pushgateway = goPackages.prometheus.pushgateway.bin // { outputs = [ "bin" ]; }; prometheus-statsd-bridge = goPackages.prometheus.statsd-bridge.bin // { outputs = [ "bin" ]; }; diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index 44dc1260c37d..8542cde5392e 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -2585,22 +2585,6 @@ let propagatedBuildInputs = [ logrus ]; }; - prometheus.nginx-exporter = buildFromGitHub { - rev = "2cf16441591f6b6e58a8c0439dcaf344057aea2b"; - version = "2015-06-01"; - owner = "discordianfish"; - repo = "nginx_exporter"; - sha256 = "0p9j0bbr2lr734980x2p8d67lcify21glwc5k3i3j4ri4vadpxvc"; - buildInputs = [ prometheus.client_golang prometheus.log ]; - meta = with stdenv.lib; { - description = "Metrics relay from nginx stats to Prometheus"; - homepage = https://github.com/discordianfish/nginx_exporter; - license = licenses.asl20; - maintainers = with maintainers; [ benley ]; - platforms = platforms.unix; - }; - }; - prometheus.node-exporter = buildFromGitHub { rev = "0.11.0"; owner = "prometheus";