From: Pieter Lexis Date: Mon, 22 Oct 2018 14:54:54 +0000 (+0200) Subject: dnsdist: Add HELP and TYPE for dnsdist_server_ stats X-Git-Tag: dnsdist-1.3.3~36^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7089%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Add HELP and TYPE for dnsdist_server_ stats --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 810a4b9433..a50d68f554 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;