diff --git a/pkgs/servers/monitoring/prometheus/pushgateway/default.nix b/pkgs/servers/monitoring/prometheus/pushgateway/default.nix new file mode 100644 index 000000000000..db66e963208e --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/pushgateway/default.nix @@ -0,0 +1,51 @@ +{ stdenv, lib, goPackages, fetchFromGitHub }: + +with goPackages; + +buildGoPackage rec { + name = "prometheus-pushgateway-${version}"; + version = "0.1.0"; + goPackagePath = "github.com/prometheus/pushgateway"; + rev = "3f1d42dade342ddb88381607358bae61a0a6b6c7"; + + src = fetchFromGitHub { + inherit rev; + owner = "prometheus"; + repo = "pushgateway"; + sha256 = "1wqxbl9rlnxszp9ylvdbx6f5lyj2z0if3x099fnjahbqmz8yhnf4"; + }; + + buildInputs = [ + go-bindata + protobuf + httprouter + golang_protobuf_extensions + prometheus.client_golang + ]; + + buildFlagsArray = '' + -ldflags= + -X main.buildVersion ${version} + -X main.buildRev ${rev} + -X main.buildBranch master + -X main.buildUser nix@nixpkgs + -X main.buildDate 20150101-00:00:00 + -X main.goVersion ${lib.getVersion go} + ''; + + preBuild = '' + ( + cd "go/src/$goPackagePath" + go-bindata ./resources/ + ) + ''; + + meta = with lib; { + description = + "Allows ephemeral and batch jobs to expose metrics to Prometheus"; + homepage = https://github.com/prometheus/pushgateway; + license = licenses.asl20; + maintainers = with maintainers; [ benley ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 74930f357e83..c56340229fe2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8387,6 +8387,8 @@ let callPackage ../servers/monitoring/prometheus/alertmanager { }; prometheus-haproxy-exporter = callPackage ../servers/monitoring/prometheus/haproxy_exporter { }; + prometheus-pushgateway = + callPackage ../servers/monitoring/prometheus/pushgateway { }; psqlodbc = callPackage ../servers/sql/postgresql/psqlodbc { };