Merge pull request #90729 from WilliButz/exporter-passthru-tests

prometheus-exporters: expose tests in exporter definitions
This commit is contained in:
Maximilian Bosch 2020-06-19 22:10:26 +02:00 committed by GitHub
commit 649b039a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 76 additions and 28 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "apcupsd-exporter";
@ -13,6 +13,8 @@ buildGoModule rec {
vendorSha256 = "09x8y8pmgfn897hvnk122ry460y12b8a7y5fafri5wn9vxab9r82";
passthru.tests = { inherit (nixosTests.prometheus-exporters) apcupsd; };
meta = with stdenv.lib; {
description = "Provides a Prometheus exporter for the apcupsd Network Information Server (NIS)";
homepage = "https://github.com/mdlayher/apcupsd_exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "bind_exporter";
@ -14,6 +14,8 @@ buildGoPackage rec {
sha256 = "1nd6pc1z627w4x55vd42zfhlqxxjmfsa9lyn0g6qq19k4l85v1qm";
};
passthru.tests = { inherit (nixosTests.prometheus-exporters) bind; };
meta = with stdenv.lib; {
description = "Prometheus exporter for bind9 server";
homepage = "https://github.com/digitalocean/bind_exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "blackbox_exporter";
@ -17,6 +17,8 @@ buildGoPackage rec {
# dns-lookup is performed for the tests
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) blackbox; };
meta = with stdenv.lib; {
description = "Blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP";
homepage = "https://github.com/prometheus/blackbox_exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "collectd-exporter";
@ -14,6 +14,8 @@ buildGoPackage rec {
sha256 = "1p0kb7c8g0r0sp5a6xrx8vnwbw14hhwlqzk4n2xx2y8pvnbivajz";
};
passthru.tests = { inherit (nixosTests.prometheus-exporters) collectd; };
meta = with stdenv.lib; {
description = "Relay server for exporting metrics from collectd to Prometheus";
homepage = "https://github.com/prometheus/collectd_exporter";

View File

@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, python3Packages }:
{ lib, fetchFromGitHub, python3Packages, nixosTests }:
python3Packages.buildPythonApplication rec {
pname = "prometheus-cups-exporter-unstable";
@ -26,6 +26,8 @@ python3Packages.buildPythonApplication rec {
--add-flags "$out/share/cups_exporter.py"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) cups; };
meta = with lib; {
description = "A simple prometheus exporter for cups implemented in python";
homepage = "https://github.com/ThoreKr/cups_exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "dnsmasq_exporter";
@ -13,10 +13,12 @@ buildGoModule rec {
vendorSha256 = "1dqpa180pbdi2gcmp991d4cry560mx5rm5l9x065s9n9gnd38hvl";
passthru.tests = { inherit (nixosTests.prometheus-exporters) dnsmasq; };
meta = with stdenv.lib; {
inherit (src.meta) homepage;
description = "A dnsmasq exporter for Prometheus";
license = licenses.asl20;
maintainers = with maintainers; [ willibutz globin ma27 ];
};
}
}

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "dovecot_exporter";
@ -15,6 +15,8 @@ buildGoPackage rec {
goDeps = ./dovecot-exporter-deps.nix;
passthru.tests = { inherit (nixosTests.prometheus-exporters) dovecot; };
meta = with stdenv.lib; {
inherit (src.meta) homepage;
description = "Prometheus metrics exporter for Dovecot";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "fritzbox-exporter";
@ -16,6 +16,8 @@ buildGoPackage rec {
goDeps = ./fritzbox-exporter-deps.nix;
passthru.tests = { inherit (nixosTests.prometheus-exporters) fritzbox; };
meta = with stdenv.lib; {
description = "Prometheus Exporter for FRITZ!Box (TR64 and UPnP)";
homepage = "https://github.com/ndecker/fritzbox_exporter";

View File

@ -1,5 +1,5 @@
# This file was generated by go2nix.
{ buildGoPackage, fetchFromGitHub, fetchpatch, lib }:
{ buildGoPackage, fetchFromGitHub, fetchpatch, lib, nixosTests }:
buildGoPackage {
pname = "prometheus-json-exporter";
@ -21,6 +21,8 @@ buildGoPackage {
sha256 = "0mc5axhd2bykci41dgswl4r1552d70jsmb17lbih7czhsy6rgmrm";
})];
passthru.tests = { inherit (nixosTests.prometheus-exporters) json; };
meta = with lib; {
description = "A prometheus exporter which scrapes remote JSON by JSONPath";
homepage = "https://github.com/kawamuray/prometheus-json-exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "keylight-exporter";
@ -13,6 +13,8 @@ buildGoModule rec {
vendorSha256 = "0w065ls8dp687jmps4xdffcarss1wyls14dngr43g58xjw6519gb";
passthru.tests = { inherit (nixosTests.prometheus-exporters) keylight; };
meta = with stdenv.lib; {
homepage = "https://github.com/mdlayher/keylight_exporter";
description = "Prometheus exporter for Elgato Key Light devices.";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "lndmon-unstable";
@ -13,6 +13,8 @@ buildGoModule rec {
vendorSha256 = "083h2ksnqmcr48958r5pag9a28xvljpc3prip6wn70ifp2wpjpin";
passthru.tests = { inherit (nixosTests.prometheus-exporters) lnd; };
meta = with stdenv.lib; {
inherit (src.meta) homepage;
description = "Prometheus exporter for lnd (Lightning Network Daemon)";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }:
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles, nixosTests }:
buildGoPackage {
pname = "mailexporter";
@ -22,6 +22,8 @@ buildGoPackage {
installManPage $src/man/mailexporter.conf.5
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) mail; };
meta = with stdenv.lib; {
description = "Export Prometheus-style metrics about mail server functionality";
homepage = "https://github.com/cherti/mailexporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "mikrotik-exporter-unstable";
@ -13,10 +13,12 @@ buildGoModule rec {
vendorSha256 = "0i5x4d3ra0s41knmybbg8gnjxgraxkid6y3gfkjwa65xcbp7hr7q";
passthru.tests = { inherit (nixosTests.prometheus-exporters) mikrotik; };
meta = with stdenv.lib; {
inherit (src.meta) homepage;
description = "Prometheus MikroTik device(s) exporter";
license = licenses.bsd3;
maintainers = with maintainers; [ mmilata ];
};
}
}

View File

@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, buildGoPackage }:
{ lib, fetchFromGitHub, buildGoPackage, nixosTests }:
buildGoPackage rec {
pname = "prometheus-nextcloud-exporter";
@ -17,6 +17,8 @@ buildGoPackage rec {
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) nextcloud; };
meta = with lib; {
description = "Prometheus exporter for Nextcloud servers.";
homepage = "https://github.com/xperimental/nextcloud-exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "nginx_exporter";
@ -19,6 +19,8 @@ buildGoPackage rec {
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginx; };
meta = with stdenv.lib; {
description = "NGINX Prometheus Exporter for NGINX and NGINX Plus";
homepage = "https://github.com/nginxinc/nginx-prometheus-exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "node_exporter";
@ -23,6 +23,8 @@ buildGoPackage rec {
-X ${goPackagePath}/vendor/github.com/prometheus/common/version.Revision=${rev}
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
meta = with stdenv.lib; {
description = "Prometheus exporter for machine metrics";
homepage = "https://github.com/prometheus/node_exporter";

View File

@ -1,5 +1,5 @@
{ stdenv, buildGoPackage, fetchFromGitHub, systemd, makeWrapper
, withSystemdSupport ? true }:
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, nixosTests
, systemd, withSystemdSupport ? true }:
with stdenv.lib;
@ -47,6 +47,8 @@ buildGoPackage rec {
--prefix LD_LIBRARY_PATH : "${systemd.lib}/lib"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) postfix; };
meta = {
inherit (src.meta) homepage;
description = "A Prometheus exporter for Postfix";

View File

@ -1,4 +1,4 @@
{ lib, buildGoPackage, fetchFromGitHub }:
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "postgres_exporter";
@ -15,6 +15,8 @@ buildGoPackage rec {
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) postgres; };
meta = with lib; {
inherit (src.meta) homepage;
description = "A Prometheus exporter for PostgreSQL";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "redis_exporter";
@ -22,6 +22,8 @@ buildGoPackage rec {
-X main.BuildDate=unknown
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) redis; };
meta = with stdenv.lib; {
description = "Prometheus exporter for Redis metrics";
inherit (src.meta) homepage;

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, net-snmp }:
{ stdenv, buildGoPackage, fetchFromGitHub, net-snmp, nixosTests }:
buildGoPackage rec {
pname = "snmp_exporter";
@ -17,6 +17,8 @@ buildGoPackage rec {
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) snmp; };
meta = with stdenv.lib; {
description = "SNMP Exporter for Prometheus";
homepage = "https://github.com/prometheus/snmp_exporter";

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "surfboard_exporter";
@ -13,6 +13,8 @@ buildGoPackage rec {
sha256 = "11qms26648nwlwslnaflinxcr5rnp55s908rm1qpnbz0jnxf5ipw";
};
passthru.tests = { inherit (nixosTests.prometheus-exporters) surfboard; };
meta = with stdenv.lib; {
description = "Arris Surfboard signal metrics exporter";
homepage = "https://github.com/ipstatic/surfboard_exporter";

View File

@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, python3Packages }:
{ lib, fetchFromGitHub, python3Packages, nixosTests }:
python3Packages.buildPythonApplication rec {
name = "tor-exporter-${version}";
@ -27,6 +27,8 @@ python3Packages.buildPythonApplication rec {
--add-flags "$out/share/prometheus-tor-exporter.py"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) tor; };
meta = with lib; {
description = "Prometheus exporter that exposes metrics from a Tor daemon";
homepage = "https://github.com/atx/prometheus-tor_exporter";

View File

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, varnish }:
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, varnish, nixosTests }:
buildGoModule rec {
pname = "prometheus_varnish_exporter";
@ -22,10 +22,12 @@ buildGoModule rec {
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) varnish; };
meta = {
homepage = "https://github.com/jonnenauha/prometheus_varnish_exporter";
description = "Varnish exporter for Prometheus";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ MostAwesomeDude willibutz ];
};
}
}

View File

@ -1,4 +1,4 @@
{ stdenv, rustPlatform, fetchFromGitHub, lib, Security }:
{ stdenv, rustPlatform, fetchFromGitHub, lib, Security, nixosTests }:
rustPlatform.buildRustPackage rec {
pname = "wireguard-exporter";
@ -15,6 +15,8 @@ rustPlatform.buildRustPackage rec {
buildInputs = lib.optional stdenv.isDarwin Security;
passthru.tests = { inherit (nixosTests.prometheus-exporters) wireguard; };
meta = with lib; {
description = "A Prometheus exporter for WireGuard, written in Rust.";
homepage = "https://github.com/MindFlavor/prometheus_wireguard_exporter";