about summary refs log tree commit diff
path: root/pkgs/servers/monitoring/prometheus/kea-exporter.nix
blob: 721f69763fc0ff4f9ab89dde4bb30d7d0591ffa6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ lib
, python3Packages
, fetchPypi
, nixosTests
}:

python3Packages.buildPythonApplication rec {
  pname = "kea-exporter";
  version = "0.6.1";
  format = "pyproject";

  src = fetchPypi {
    pname = "kea_exporter";
    inherit version;
    hash = "sha256-PyNFSTDqT+PBY7d9NSG1FVhN+Y3ID13T6859kBYsFzU=";
  };

  nativeBuildInputs = with python3Packages; [
    pdm-backend
  ];

  propagatedBuildInputs = with python3Packages; [
    click
    prometheus-client
    requests
  ];

  checkPhase = ''
    $out/bin/kea-exporter --help > /dev/null
    $out/bin/kea-exporter --version | grep -q ${version}
  '';

  passthru.tests = {
    inherit (nixosTests.prometheus-exporters) kea;
  };

  meta = with lib; {
    changelog = "https://github.com/mweinelt/kea-exporter/blob/v${version}/HISTORY";
    description = "Export Kea Metrics in the Prometheus Exposition Format";
    mainProgram = "kea-exporter";
    homepage = "https://github.com/mweinelt/kea-exporter";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
  };
}