about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/monitoring/prometheus/knot-exporter.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/monitoring/prometheus/knot-exporter.nix')
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/knot-exporter.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/knot-exporter.nix b/nixpkgs/pkgs/servers/monitoring/prometheus/knot-exporter.nix
new file mode 100644
index 000000000000..f15dc626e59f
--- /dev/null
+++ b/nixpkgs/pkgs/servers/monitoring/prometheus/knot-exporter.nix
@@ -0,0 +1,41 @@
+{ lib
+, python3
+, fetchPypi
+, nixosTests
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "knot-exporter";
+  version = "3.3.5";
+  pyproject = true;
+
+  src = fetchPypi {
+    pname = "knot_exporter";
+    inherit version;
+    hash = "sha256-7r4zXqomiszDrplMedEyw2ZQ2NwDTf54EOwnsLc5RJ0=";
+  };
+
+  nativeBuildInputs = [
+    python3.pkgs.hatchling
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    libknot
+    prometheus-client
+    psutil
+  ];
+
+  pythonImportsCheck = [
+    "knot_exporter"
+  ];
+
+  passthru.tests = { inherit (nixosTests.prometheus-exporters) knot; };
+
+  meta = with lib; {
+    description = "Prometheus exporter for Knot DNS";
+    homepage = "https://gitlab.nic.cz/knot/knot-dns/-/tree/master/python/knot_exporter";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ ma27 hexa ];
+    mainProgram = "knot-exporter";
+  };
+}