From: Holger Hoffstätte Date: Mon, 21 Jun 2021 15:01:11 +0000 (+0200) Subject: Dnsdist: Do not report latency metrics of down upstream servers X-Git-Tag: dnsdist-1.7.0-alpha1~118^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d8c3a50deb5a5138dd53c8b692d4fef1c25ceda;p=thirdparty%2Fpdns.git Dnsdist: Do not report latency metrics of down upstream servers --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 9d31b3aefa..5eca7074e4 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -507,7 +507,8 @@ static void handlePrometheus(const YaHTTP::Request& req, YaHTTP::Response& resp) output << statesbase << "queries" << label << " " << state->queries.load() << "\n"; output << statesbase << "responses" << label << " " << state->responses.load() << "\n"; output << statesbase << "drops" << label << " " << state->reuseds.load() << "\n"; - output << statesbase << "latency" << label << " " << state->latencyUsec/1000.0 << "\n"; + if (state->isUp()) + output << statesbase << "latency" << label << " " << state->latencyUsec/1000.0 << "\n"; output << statesbase << "senderrors" << label << " " << state->sendErrors.load() << "\n"; output << statesbase << "outstanding" << label << " " << state->outstanding.load() << "\n"; output << statesbase << "order" << label << " " << state->order << "\n"; @@ -517,7 +518,7 @@ static void handlePrometheus(const YaHTTP::Request& req, YaHTTP::Response& resp) output << statesbase << "tcpgaveup" << label << " " << state->tcpGaveUp << "\n"; output << statesbase << "tcpreadtimeouts" << label << " " << state->tcpReadTimeouts << "\n"; output << statesbase << "tcpwritetimeouts" << label << " " << state->tcpWriteTimeouts << "\n"; - output << statesbase << "tcpconnecttimeouts" << label << " " << state->tcpConnectTimeouts << "\n"; + output << statesbase << "tcpconnecttimeouts" << label << " " << state->tcpConnectTimeouts << "\n"; output << statesbase << "tcpcurrentconnections" << label << " " << state->tcpCurrentConnections << "\n"; output << statesbase << "tcpmaxconcurrentconnections" << label << " " << state->tcpMaxConcurrentConnections << "\n"; output << statesbase << "tcpnewconnections" << label << " " << state->tcpNewConnections << "\n";