From: Otto Moerbeek Date: Mon, 3 Oct 2022 08:14:22 +0000 (+0200) Subject: Add dnstapNODFrameStream stats X-Git-Tag: rec-4.9.0-alpha0~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=653baee4a66db7fc7cec3683c915692cd532e8e1;p=thirdparty%2Fpdns.git Add dnstapNODFrameStream stats Fix docs refs Fix #ifdef --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 99549af899..bd89c6d6f1 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -986,6 +986,18 @@ static RemoteLoggerStats_t* pleaseGetFramestreamLoggerStats() } return ret.release(); } + +static RemoteLoggerStats_t* pleaseGetNODFramestreamLoggerStats() +{ + auto ret = make_unique(); + + if (t_nodFrameStreamServersInfo.servers) { + for (const auto& server : *t_nodFrameStreamServersInfo.servers) { + ret->emplace(std::make_pair(server->address(), server->getStats())); + } + } + return ret.release(); +} #endif static void remoteLoggerStats(const string& type, const RemoteLoggerStats_t& stats, ostringstream& outpustStream) @@ -1010,6 +1022,8 @@ static string getRemoteLoggerStats() #ifdef HAVE_FSTRM stats = broadcastAccFunction(pleaseGetFramestreamLoggerStats); remoteLoggerStats("dnstapFrameStream", stats, outputStream); + stats = broadcastAccFunction(pleaseGetNODFramestreamLoggerStats); + remoteLoggerStats("dnstapNODFrameStream", stats, outputStream); #endif return outputStream.str(); } @@ -1269,9 +1283,11 @@ static StatsMap toRemoteLoggerStatsMap(const string& name) list.emplace_back(stats1, "protobuf"); auto stats2 = broadcastAccFunction(pleaseGetOutgoingRemoteLoggerStats); list.emplace_back(stats2, "outgoingProtobuf"); -#ifdef HAVE_FSTREAM +#ifdef HAVE_FSTRM auto stats3 = broadcastAccFunction(pleaseGetFramestreamLoggerStats); list.emplace_back(stats3, "dnstapFrameStream"); + auto stats4 = broadcastAccFunction(pleaseGetNODFramestreamLoggerStats); + list.emplace_back(stats4, "dnstapNODFrameStream"); #endif uint64_t count = 0; for (const auto& [stats, type] : list) { diff --git a/pdns/recursordist/docs/nod_udr.rst b/pdns/recursordist/docs/nod_udr.rst index a009e4c9a6..2da15412ad 100644 --- a/pdns/recursordist/docs/nod_udr.rst +++ b/pdns/recursordist/docs/nod_udr.rst @@ -32,7 +32,7 @@ DNS Lookup ++++++++++ The setting ``new-domain-lookup=`` will cause the recursor to issue a DNS A record lookup to ``.``. This can be a suitable method to send NOD data to an offsite or remote partner, however care should be taken to ensure that data is not leaked inadvertently. -To log NOD information to a dnstap stream, refer to :func:`dnstapFrameStreamServer`. +To log NOD information to a dnstap stream, refer to :func:`dnstapNODFrameStreamServer`. Protobuf Logging ++++++++++++++++ @@ -65,7 +65,7 @@ Logging +++++++ The setting ``unique-response-log`` is enabled by default once the NOD feature is enabled, and will log the newly observed domain to the recursor logfile. -To log UDR information to a dnstap stream, refer to :func:`dnstapFrameStreamServer`. +To log UDR information to a dnstap stream, refer to :func:`dnstapNODFrameStreamServer`. Protobuf Logging ++++++++++++++++