Skip to content

Commit

Permalink
prometheus-exporters: expose tests in exporter definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliButz committed Jun 18, 2020
1 parent e4fd4b2 commit 7449a32
Show file tree
Hide file tree
Showing 24 changed files with 76 additions and 28 deletions.
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/apcupsd-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:

buildGoModule rec {
pname = "apcupsd-exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/bind-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "bind_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/blackbox-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "blackbox_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/collectd-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "collectd-exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/cups-exporter.nix
@@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, python3Packages }:
{ lib, fetchFromGitHub, python3Packages, nixosTests }:

python3Packages.buildPythonApplication rec {
pname = "prometheus-cups-exporter-unstable";
Expand Down Expand Up @@ -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";
Expand Down
6 changes: 4 additions & 2 deletions pkgs/servers/monitoring/prometheus/dnsmasq-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:

buildGoModule rec {
pname = "dnsmasq_exporter";
Expand All @@ -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 ];
};
}
}
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/dovecot-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "dovecot_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/fritzbox-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "fritzbox-exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/json-exporter.nix
@@ -1,5 +1,5 @@
# This file was generated by go2nix.
{ buildGoPackage, fetchFromGitHub, fetchpatch, lib }:
{ buildGoPackage, fetchFromGitHub, fetchpatch, lib, nixosTests }:

buildGoPackage {
pname = "prometheus-json-exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/keylight-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:

buildGoModule rec {
pname = "keylight-exporter";
Expand All @@ -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.";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/lnd-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:

buildGoModule rec {
pname = "lndmon-unstable";
Expand All @@ -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)";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/mail-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }:
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles, nixosTests }:

buildGoPackage {
pname = "mailexporter";
Expand All @@ -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";
Expand Down
6 changes: 4 additions & 2 deletions pkgs/servers/monitoring/prometheus/mikrotik-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:

buildGoModule rec {
pname = "mikrotik-exporter-unstable";
Expand All @@ -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 ];
};
}
}
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/nextcloud-exporter.nix
@@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, buildGoPackage }:
{ lib, fetchFromGitHub, buildGoPackage, nixosTests }:

buildGoPackage rec {
pname = "prometheus-nextcloud-exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/nginx-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "nginx_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/node-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "node_exporter";
Expand All @@ -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";
Expand Down
6 changes: 4 additions & 2 deletions pkgs/servers/monitoring/prometheus/postfix-exporter.nix
@@ -1,5 +1,5 @@
{ stdenv, buildGoPackage, fetchFromGitHub, systemd, makeWrapper
, withSystemdSupport ? true }:
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, nixosTests
, systemd, withSystemdSupport ? true }:

with stdenv.lib;

Expand Down Expand Up @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/postgres-exporter.nix
@@ -1,4 +1,4 @@
{ lib, buildGoPackage, fetchFromGitHub }:
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "postgres_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/redis-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "redis_exporter";
Expand All @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/snmp-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, net-snmp }:
{ stdenv, buildGoPackage, fetchFromGitHub, net-snmp, nixosTests }:

buildGoPackage rec {
pname = "snmp_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/surfboard-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:

buildGoPackage rec {
pname = "surfboard_exporter";
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/tor-exporter.nix
@@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, python3Packages }:
{ lib, fetchFromGitHub, python3Packages, nixosTests }:

python3Packages.buildPythonApplication rec {
name = "tor-exporter-${version}";
Expand Down Expand Up @@ -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";
Expand Down
6 changes: 4 additions & 2 deletions pkgs/servers/monitoring/prometheus/varnish-exporter.nix
@@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, varnish }:
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, varnish, nixosTests }:

buildGoModule rec {
pname = "prometheus_varnish_exporter";
Expand All @@ -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 ];
};
}
}
4 changes: 3 additions & 1 deletion pkgs/servers/monitoring/prometheus/wireguard-exporter.nix
@@ -1,4 +1,4 @@
{ stdenv, rustPlatform, fetchFromGitHub, lib, Security }:
{ stdenv, rustPlatform, fetchFromGitHub, lib, Security, nixosTests }:

rustPlatform.buildRustPackage rec {
pname = "wireguard-exporter";
Expand All @@ -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";
Expand Down

0 comments on commit 7449a32

Please sign in to comment.