From a3cf92fdba05742afe26ca1e0bb8bdc056181175 Mon Sep 17 00:00:00 2001 From: Kamil Chmielewski Date: Sun, 5 Jun 2016 14:59:43 +0200 Subject: [PATCH] prometheus-collectd-exporter: extracted from goPackages --- pkgs/development/go-modules/libs.json | 21 ++++++++++---- .../prometheus/collectd-exporter.nix | 28 +++++++++++++++++++ .../prometheus/collectd-exporter_deps.json | 14 ++++++++++ pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/go-packages.nix | 15 ---------- 5 files changed, 58 insertions(+), 22 deletions(-) create mode 100644 pkgs/servers/monitoring/prometheus/collectd-exporter.nix create mode 100644 pkgs/servers/monitoring/prometheus/collectd-exporter_deps.json diff --git a/pkgs/development/go-modules/libs.json b/pkgs/development/go-modules/libs.json index d2564c0be3a..5e2e37a858f 100644 --- a/pkgs/development/go-modules/libs.json +++ b/pkgs/development/go-modules/libs.json @@ -400,8 +400,8 @@ "fetch": { "type": "git", "url": "https://github.com/beorn7/perks", - "rev": "3ac7bf7a47d159a033b107610db8a1b6575507a4", - "sha256": "1qc3l4r818xpvrhshh1sisc5lvl9479qspcfcdbivdyh0apah83r" + "rev": "b965b613227fddccbfffe13eae360ed3fa822f8d", + "sha256": "1p8zsj4r0g61q922khfxpwxhdma2dx4xad1m5qx43mfn28kxngqk" } }, { @@ -418,8 +418,8 @@ "fetch": { "type": "git", "url": "https://github.com/matttproud/golang_protobuf_extensions", - "rev": "d0c3fe89de86839aecf2e0579c40ba3bb336a453", - "sha256": "0jkjgpi1s8l9bdbf14fh8050757jqy36kn1l1hxxlb2fjn1pcg0r" + "rev": "fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a", + "sha256": "0ajg41h6402big484drvm72wvid1af2sffw0qkzbmpy04lq68ahj" } }, { @@ -463,8 +463,8 @@ "fetch": { "type": "git", "url": "https://github.com/prometheus/procfs", - "rev": "406e5b7bfd8201a36e2bb5f7bdae0b03380c2ce8", - "sha256": "0yla9hz15pg63394ygs9iiwzsqyv29labl8p424hijwsc9z9nka8" + "rev": "c91d8eefde16bd047416409eb56353ea84a186e4", + "sha256": "0pj3gzw9b58l72w0rkpn03ayssglmqfmyxghhfad6mh0b49dvj3r" } }, { @@ -1186,5 +1186,14 @@ "rev": "91c1edb38c241d73129e6b098ca1c9fa83abfc15", "sha256": "156ixlhakpqgyp35rsvmndrqz8aggv5bcmzg9ynpri3b9j6kim4d" } + }, + { + "goPackagePath": "bitbucket.org/ww/goautoneg", + "fetch": { + "type": "hg", + "url": "bitbucket.org/ww/goautoneg", + "rev": "75cd24fc2f2c2a2088577d12123ddee5f54e0675", + "sha256": "19khhn5xhqv1yp7d6k987gh5w5rhrjnp4p0c6fyrd8z6lzz5h9qi" + } } ] diff --git a/pkgs/servers/monitoring/prometheus/collectd-exporter.nix b/pkgs/servers/monitoring/prometheus/collectd-exporter.nix new file mode 100644 index 00000000000..3b22fedfd93 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/collectd-exporter.nix @@ -0,0 +1,28 @@ +# This file was generated by go2nix. +{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +with goPackages; + +buildGoPackage rec { + name = "collectd-exporter-${version}"; + version = "0.1.0"; + rev = version; + + goPackagePath = "github.com/prometheus/collectd_exporter"; + + src= fetchgit { + inherit rev; + url = "https://github.com/prometheus/collectd_exporter"; + sha256 = "165zsdn0lffb6fvxz75szmm152a6wmia5skb96k1mv59qbmn9fi1"; + }; + + goDeps = ./collectd-exporter_deps.json; + + meta = with stdenv.lib; { + description = "Relay server for exporting metrics from collectd to Prometheus"; + homepage = https://github.com/prometheus/alertmanager; + license = licenses.asl20; + maintainers = with maintainers; [ benley ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/servers/monitoring/prometheus/collectd-exporter_deps.json b/pkgs/servers/monitoring/prometheus/collectd-exporter_deps.json new file mode 100644 index 00000000000..ea82d4900ff --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/collectd-exporter_deps.json @@ -0,0 +1,14 @@ +[ + { + "include": "../../libs.json", + "packages": [ + "github.com/prometheus/client_golang", + "github.com/prometheus/client_model", + "github.com/prometheus/procfs", + "bitbucket.org/ww/goautoneg", + "github.com/beorn7/perks", + "github.com/golang/protobuf", + "github.com/matttproud/golang_protobuf_extensions" + ] + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 60c17c0be72..41c3f33fbb5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10181,7 +10181,7 @@ in prometheus = callPackage ../servers/monitoring/prometheus { }; prometheus-alertmanager = callPackage ../servers/monitoring/prometheus/alertmanager.nix { }; prometheus-cli = callPackage ../servers/monitoring/prometheus/cli.nix { }; - prometheus-collectd-exporter = goPackages.prometheus.collectd-exporter.bin // { outputs = [ "bin" ]; }; + prometheus-collectd-exporter = callPackage ../servers/monitoring/prometheus/collectd-exporter.nix { }; prometheus-haproxy-exporter = goPackages.prometheus.haproxy-exporter.bin // { outputs = [ "bin" ]; }; prometheus-mesos-exporter = goPackages.prometheus.mesos-exporter.bin // { outputs = [ "bin" ]; }; prometheus-mysqld-exporter = goPackages.prometheus.mysqld-exporter.bin // { outputs = [ "bin" ]; }; diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index e15da20cf3f..a0f0bf0efc7 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -2588,21 +2588,6 @@ let buildInputs = [ protobuf ]; }; - prometheus.collectd-exporter = buildFromGitHub { - rev = "0.1.0"; - owner = "prometheus"; - repo = "collectd_exporter"; - sha256 = "165zsdn0lffb6fvxz75szmm152a6wmia5skb96k1mv59qbmn9fi1"; - buildInputs = [ prometheus.client_golang ]; - meta = with stdenv.lib; { - description = "Relay server for exporting metrics from collectd to Prometheus"; - homepage = https://github.com/prometheus/alertmanager; - license = licenses.asl20; - maintainers = with maintainers; [ benley ]; - platforms = platforms.unix; - }; - }; - prometheus.haproxy-exporter = buildFromGitHub { rev = "0.4.0"; owner = "prometheus";