From 4bf5a93f2dee5628dc5a9a456464aec13c20f438 Mon Sep 17 00:00:00 2001 From: Kamil Chmielewski Date: Sun, 5 Jun 2016 13:44:04 +0200 Subject: [PATCH] prom2json: extracted from goPackages --- pkgs/development/go-modules/libs.json | 4 +-- .../monitoring/prometheus/prom2json.nix | 28 +++++++++++++++++++ .../monitoring/prometheus/prom2json_deps.json | 11 ++++++++ pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/go-packages.nix | 21 -------------- 5 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 pkgs/servers/monitoring/prometheus/prom2json.nix create mode 100644 pkgs/servers/monitoring/prometheus/prom2json_deps.json diff --git a/pkgs/development/go-modules/libs.json b/pkgs/development/go-modules/libs.json index 81ceb71f9351..d2564c0be3a1 100644 --- a/pkgs/development/go-modules/libs.json +++ b/pkgs/development/go-modules/libs.json @@ -427,8 +427,8 @@ "fetch": { "type": "git", "url": "https://github.com/prometheus/client_golang", - "rev": "90c15b5efa0dc32a7d259234e02ac9a99e6d3b82", - "sha256": "11hbll3x7hm69a7b0pwnhz5diligjy5yykdkqz2rsvs8s1k796zm" + "rev": "6dbab8106ed3ed77359ac85d9cf08e30290df864", + "sha256": "1i3g5h2ncdb8b67742kfpid7d0a1jas1pyicglbglwngfmzhpkna" } }, { diff --git a/pkgs/servers/monitoring/prometheus/prom2json.nix b/pkgs/servers/monitoring/prometheus/prom2json.nix new file mode 100644 index 000000000000..512cd4ca22ca --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/prom2json.nix @@ -0,0 +1,28 @@ +# This file was generated by go2nix. +{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +with goPackages; + +buildGoPackage rec { + name = "prom2json-${version}"; + version = "0.1.0"; + rev = "${version}"; + + goPackagePath = "github.com/prometheus/prom2json"; + + src = fetchgit { + inherit rev; + url = "https://github.com/prometheus/prom2json"; + sha256 = "0wwh3mz7z81fwh8n78sshvj46akcgjhxapjgfic5afc4nv926zdl"; + }; + + goDeps = ./prom2json_deps.json; + + meta = with stdenv.lib; { + description = "Tool to scrape a Prometheus client and dump the result as JSON"; + homepage = https://github.com/prometheus/prom2json; + license = licenses.asl20; + maintainers = with maintainers; [ benley ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/servers/monitoring/prometheus/prom2json_deps.json b/pkgs/servers/monitoring/prometheus/prom2json_deps.json new file mode 100644 index 000000000000..a8569d8a25f8 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/prom2json_deps.json @@ -0,0 +1,11 @@ +[ + { + "include": "../../libs.json", + "packages": [ + "github.com/golang/protobuf", + "github.com/matttproud/golang_protobuf_extensions", + "github.com/prometheus/client_golang", + "github.com/prometheus/client_model" + ] + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1633c90f8370..fdf9c1f88b7a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10177,7 +10177,7 @@ in postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { }; - prom2json = goPackages.prometheus.prom2json.bin // { outputs = [ "bin" ]; }; + prom2json = callPackage ../servers/monitoring/prometheus/prom2json.nix { }; prometheus = callPackage ../servers/monitoring/prometheus { }; prometheus-alertmanager = goPackages.prometheus.alertmanager.bin // { outputs = [ "bin" ]; }; prometheus-cli = goPackages.prometheus.cli.bin // { outputs = [ "bin" ]; }; diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index a3a1aaf33714..427a2c14c449 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -2767,27 +2767,6 @@ let sha256 = "0pj3gzw9b58l72w0rkpn03ayssglmqfmyxghhfad6mh0b49dvj3r"; }; - prometheus.prom2json = buildFromGitHub { - rev = "0.1.0"; - owner = "prometheus"; - repo = "prom2json"; - sha256 = "0wwh3mz7z81fwh8n78sshvj46akcgjhxapjgfic5afc4nv926zdl"; - - buildInputs = [ - golang_protobuf_extensions - prometheus.client_golang - protobuf - ]; - - meta = with stdenv.lib; { - description = "Tool to scrape a Prometheus client and dump the result as JSON"; - homepage = https://github.com/prometheus/prom2json; - license = licenses.asl20; - maintainers = with maintainers; [ benley ]; - platforms = platforms.unix; - }; - }; - prometheus.pushgateway = buildFromGitHub rec { rev = "0.1.1"; owner = "prometheus";