]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add dnstapNODFrameStream stats
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 3 Oct 2022 08:14:22 +0000 (10:14 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 3 Oct 2022 08:14:22 +0000 (10:14 +0200)
Fix docs refs
Fix #ifdef

pdns/rec_channel_rec.cc
pdns/recursordist/docs/nod_udr.rst

index 99549af899c5e7063aaf4de9ca79e50510c4f2b6..bd89c6d6f15118b4e3208b89fdba8eae0e94b403 100644 (file)
@@ -986,6 +986,18 @@ static RemoteLoggerStats_t* pleaseGetFramestreamLoggerStats()
   }
   return ret.release();
 }
+
+static RemoteLoggerStats_t* pleaseGetNODFramestreamLoggerStats()
+{
+  auto ret = make_unique<RemoteLoggerStats_t>();
+
+  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<RemoteLoggerStats_t>(pleaseGetFramestreamLoggerStats);
   remoteLoggerStats("dnstapFrameStream", stats, outputStream);
+  stats = broadcastAccFunction<RemoteLoggerStats_t>(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<RemoteLoggerStats_t>(pleaseGetOutgoingRemoteLoggerStats);
   list.emplace_back(stats2, "outgoingProtobuf");
-#ifdef HAVE_FSTREAM
+#ifdef HAVE_FSTRM
   auto stats3 = broadcastAccFunction<RemoteLoggerStats_t>(pleaseGetFramestreamLoggerStats);
   list.emplace_back(stats3, "dnstapFrameStream");
+  auto stats4 = broadcastAccFunction<RemoteLoggerStats_t>(pleaseGetNODFramestreamLoggerStats);
+  list.emplace_back(stats4, "dnstapNODFrameStream");
 #endif
   uint64_t count = 0;
   for (const auto& [stats, type] : list) {
index a009e4c9a6b155829ba16094b16ee4629d1a13a5..2da15412ad1b6356425e16cef6de417f99f44518 100644 (file)
@@ -32,7 +32,7 @@ DNS Lookup
 ++++++++++
 
 The setting ``new-domain-lookup=<base domain>`` will cause the recursor to issue a DNS A record lookup to ``<newly observed domain>.<base domain>``. 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
 ++++++++++++++++