]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: fix build with --disable-dnstap, followup to #11903 12049/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 3 Oct 2022 06:52:44 +0000 (08:52 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 3 Oct 2022 07:24:07 +0000 (09:24 +0200)
pdns/rec_channel_rec.cc

index cff6e03508589bd73441a9ef57096407c5cd8e23..99549af899c5e7063aaf4de9ca79e50510c4f2b6 100644 (file)
@@ -1264,11 +1264,17 @@ static StatsMap toRemoteLoggerStatsMap(const string& name)
   const auto pbasename = getPrometheusName(name);
   StatsMap entries;
 
+  std::vector<std::pair<RemoteLoggerStats_t, std::string>> list;
   auto stats1 = broadcastAccFunction<RemoteLoggerStats_t>(pleaseGetRemoteLoggerStats);
+  list.emplace_back(stats1, "protobuf");
   auto stats2 = broadcastAccFunction<RemoteLoggerStats_t>(pleaseGetOutgoingRemoteLoggerStats);
+  list.emplace_back(stats2, "outgoingProtobuf");
+#ifdef HAVE_FSTREAM
   auto stats3 = broadcastAccFunction<RemoteLoggerStats_t>(pleaseGetFramestreamLoggerStats);
+  list.emplace_back(stats3, "dnstapFrameStream");
+#endif
   uint64_t count = 0;
-  for (const auto& [stats, type] : {make_pair(stats1, "protobuf"), make_pair(stats2, "outgoingProtobuf"), make_pair(stats3, "dnstapFrameStream")}) {
+  for (const auto& [stats, type] : list) {
     for (const auto& [key, entry] : stats) {
       auto keyname = pbasename + "{address=\"" + key + "\",type=\"" + type + "\",count=\"";
       auto sname1 = name + "-q-" + std::to_string(count);