1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8buildGoModule rec {
9 pname = "influxdb_exporter";
10 version = "0.12.0";
11 rev = "v${version}";
12
13 src = fetchFromGitHub {
14 inherit rev;
15 owner = "prometheus";
16 repo = "influxdb_exporter";
17 hash = "sha256-O3cH7fX29tr/rhsovoYnmTL6CE+sZQKGNj4mq1IV/5U=";
18 };
19
20 vendorHash = "sha256-RCf52lHpF4alljH/CNhCg+zgfvlYbO5WT2rFX63fyyo=";
21
22 ldflags = [
23 "-s"
24 "-w"
25 "-X github.com/prometheus/common/version.Version=${version}"
26 "-X github.com/prometheus/common/version.Revision=${rev}"
27 "-X github.com/prometheus/common/version.Branch=unknown"
28 "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
29 "-X github.com/prometheus/common/version.BuildDate=unknown"
30 ];
31
32 passthru.tests = { inherit (nixosTests.prometheus-exporters) influxdb; };
33
34 meta = with lib; {
35 description = "Prometheus exporter that accepts InfluxDB metrics";
36 mainProgram = "influxdb_exporter";
37 homepage = "https://github.com/prometheus/influxdb_exporter";
38 changelog = "https://github.com/prometheus/influxdb_exporter/blob/v${version}/CHANGELOG.md";
39 license = licenses.asl20;
40 maintainers = [ ];
41 };
42}