From e7fe227b21bb27037c5974a17eda8441e6453bd9 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 22 Oct 2018 16:54:54 +0200 Subject: [PATCH] dnsdist: Add HELP and TYPE for dnsdist_server_ stats --- pdns/dnsdist-web.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 810a4b943..a50d68f55 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -433,6 +433,21 @@ static void connectionThread(int sock, ComboAddress remote, string password, str auto states = g_dstates.getLocal(); const string statesbase = "dnsdist_server_"; + + output << "# HELP " << statesbase << "queries " << "Amount of queries relayed to server" << "\n"; + output << "# TYPE " << statesbase << "queries " << "counter" << "\n"; + output << "# HELP " << statesbase << "drops " << "Amount of queries not answered by server" << "\n"; + output << "# TYPE " << statesbase << "drops " << "counter" << "\n"; + output << "# HELP " << statesbase << "latency " << "Server's latency when answering questions in miliseconds" << "\n"; + output << "# TYPE " << statesbase << "latency " << "gauge" << "\n"; + output << "# HELP " << statesbase << "senderrors " << "Total number of OS snd errors while relaying queries" << "\n"; + output << "# TYPE " << statesbase << "senderrors " << "counter" << "\n"; + output << "# HELP " << statesbase << "outstanding " << "Current number of queries that are waiting for a backend response" << "\n"; + output << "# TYPE " << statesbase << "outstanding " << "gauge" << "\n"; + output << "# HELP " << statesbase << "order " << "The order in which this server is picked" << "\n"; + output << "# TYPE " << statesbase << "order " << "gauge" << "\n"; + output << "# HELP " << statesbase << "weight " << "The weight within the order in which this server is picked" << "\n"; + output << "# TYPE " << statesbase << "weight " << "gauge" << "\n"; for (const auto& state : *states) { string serverName; -- 2.40.0