From 41724be4e6ef85b3f5cf0d1436be13ee59becdfa Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 26 Jul 2021 13:14:43 +0200 Subject: [PATCH] prometheus-influxdb-exporter: init at 0.8.0 --- .../prometheus/influxdb-exporter.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/servers/monitoring/prometheus/influxdb-exporter.nix diff --git a/pkgs/servers/monitoring/prometheus/influxdb-exporter.nix b/pkgs/servers/monitoring/prometheus/influxdb-exporter.nix new file mode 100644 index 000000000000..65ec5ff69b41 --- /dev/null +++ b/pkgs/servers/monitoring/prometheus/influxdb-exporter.nix @@ -0,0 +1,38 @@ +{ lib, buildGoModule, fetchFromGitHub, nixosTests }: + +buildGoModule rec { + pname = "influxdb_exporter"; + version = "0.8.0"; + rev = "v${version}"; + + src = fetchFromGitHub { + inherit rev; + owner = "prometheus"; + repo = "influxdb_exporter"; + sha256 = "sha256-aNj4ru3yDet+jdcEpckFVaymmjWmKzTMPcTxPMNFbgo="; + }; + + vendorSha256 = null; + + buildFlagsArray = let + goPackagePath = "github.com/prometheus/influxdb_exporter"; + in '' + -ldflags= + -s -w + -X github.com/prometheus/common/version.Version=${version} + -X github.com/prometheus/common/version.Revision=${rev} + -X github.com/prometheus/common/version.Branch=unknown + -X github.com/prometheus/common/version.BuildUser=nix@nixpkgs + -X github.com/prometheus/common/version.BuildDate=unknown + ''; + + passthru.tests = { inherit (nixosTests.prometheus-exporters) influxdb; }; + + meta = with lib; { + description = "Prometheus exporter that accepts InfluxDB metrics"; + homepage = "https://github.com/prometheus/influxdb_exporter"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6be85174e287..b3a38eb24700 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20118,6 +20118,7 @@ in prometheus-fritzbox-exporter = callPackage ../servers/monitoring/prometheus/fritzbox-exporter.nix { }; prometheus-gitlab-ci-pipelines-exporter = callPackage ../servers/monitoring/prometheus/gitlab-ci-pipelines-exporter.nix { }; prometheus-haproxy-exporter = callPackage ../servers/monitoring/prometheus/haproxy-exporter.nix { }; + prometheus-influxdb-exporter = callPackage ../servers/monitoring/prometheus/influxdb-exporter.nix { }; prometheus-jitsi-exporter = callPackage ../servers/monitoring/prometheus/jitsi-exporter.nix { }; prometheus-jmx-httpserver = callPackage ../servers/monitoring/prometheus/jmx-httpserver.nix { }; prometheus-json-exporter = callPackage ../servers/monitoring/prometheus/json-exporter.nix { };