From b6c8359810152534c8e6bda471e17847d279ef7e Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 12 Feb 2026 02:14:41 +0200 Subject: [PATCH 1/4] bind: add json_c for JSON statistics channel support bind_exporter 0.8.0 defaults to the JSON statistics channel instead of XML. This requires BIND to be compiled with json-c support. Without this, BIND returns 404 for /json/v1/server requests, causing the prometheus-bind-exporter to fail to retrieve metrics. --- pkgs/by-name/bi/bind/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/bi/bind/package.nix b/pkgs/by-name/bi/bind/package.nix index aa435fcb2feb..43a6c1ce1dcb 100644 --- a/pkgs/by-name/bi/bind/package.nix +++ b/pkgs/by-name/bi/bind/package.nix @@ -9,6 +9,7 @@ libidn2, libtool, libxml2, + json_c, openssl, liburcu, libuv, @@ -59,6 +60,7 @@ stdenv.mkDerivation (finalAttrs: { libidn2 libtool libxml2 + json_c openssl liburcu libuv From 95d571d0f5e203e6b7238c4251f2364a29c97765 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 12 Feb 2026 02:14:47 +0200 Subject: [PATCH 2/4] prometheus-bind-exporter: 0.7.0 -> 0.8.0 https://github.com/prometheus-community/bind_exporter/releases/tag/v0.8.0 Changelog: - [CHANGE] Drop XML statistics v2 support - [CHANGE] Deprecate collection of task stats by default - [CHANGE] Update logging library - [ENHANCEMENT] Add metric rpz_rewrites - [BUGFIX] Make log level configurable via command-line flag The exporter now defaults to JSON statistics channel instead of XML. --- pkgs/by-name/pr/prometheus-bind-exporter/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/pr/prometheus-bind-exporter/package.nix b/pkgs/by-name/pr/prometheus-bind-exporter/package.nix index 1749028329e9..b135449f097b 100644 --- a/pkgs/by-name/pr/prometheus-bind-exporter/package.nix +++ b/pkgs/by-name/pr/prometheus-bind-exporter/package.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "bind_exporter"; - version = "0.7.0"; + version = "0.8.0"; src = fetchFromGitHub { rev = "v${version}"; owner = "prometheus-community"; repo = "bind_exporter"; - sha256 = "sha256-x/XGatlXCKo9cI92JzFItApsjuZAfZX+8IZRpy7PVUo="; + sha256 = "sha256-r1P+zy3iMgPmfvIBgycW8KS0gfNOxCT9YMmHdeY4uXA="; }; - vendorHash = "sha256-f0ei/zotOj5ebURAOWUox/7J3jS2abQ5UgjninI9nRk="; + vendorHash = "sha256-/fPj5LOe3QdnVPdtYdaqtnGMJ7/SZ458mpvjwO8TxEI="; passthru.tests = { inherit (nixosTests.prometheus-exporters) bind; }; From d9a2e3b3c0ba8d4edf67475e1c64b00202cc58c6 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 12 Feb 2026 02:14:53 +0200 Subject: [PATCH 3/4] nixos/prometheus-exporters/bind: update for bind_exporter 0.8.0 - Change default bindVersion from 'auto' to 'json' (new upstream default) - Add 'json' and 'xml' to bindVersion enum options - Remove deprecated 'xml.v2' option (dropped in 0.8.0) --- .../services/monitoring/prometheus/exporters/bind.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/monitoring/prometheus/exporters/bind.nix b/nixos/modules/services/monitoring/prometheus/exporters/bind.nix index 3390374172c4..935ebff7e5bd 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/bind.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/bind.nix @@ -17,7 +17,7 @@ in type = types.str; default = "http://localhost:8053/"; description = '' - HTTP XML API address of an Bind server. + HTTP API address of a BIND server. ''; }; bindTimeout = mkOption { @@ -29,13 +29,14 @@ in }; bindVersion = mkOption { type = types.enum [ - "xml.v2" + "json" + "xml" "xml.v3" "auto" ]; - default = "auto"; + default = "json"; description = '' - BIND statistics version. Can be detected automatically. + BIND statistics version. Defaults to JSON. ''; }; bindGroups = mkOption { From f9e4559b773822abfa1c3a8decc9377144aa3bb2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 12 Feb 2026 02:14:58 +0200 Subject: [PATCH 4/4] nixosTests.prometheus-exporters.bind: check bind_up metric Check for 'bind_up 1' instead of 'bind_query_recursions_total 0'. The bind_query_recursions_total metric is only emitted when there have been recursive queries. In a fresh BIND instance with no traffic, this counter doesn't exist. The bind_up metric reliably indicates that the exporter successfully connected to BIND's statistics channel. --- nixos/tests/prometheus-exporters.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 6383f1b54cfd..3f8d5fa61110 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -108,7 +108,7 @@ let wait_for_unit("prometheus-bind-exporter.service") wait_for_open_port(9119) succeed( - "curl -sSf http://localhost:9119/metrics | grep 'bind_query_recursions_total 0'" + "curl -sSf http://localhost:9119/metrics | grep 'bind_up 1'" ) ''; };