From: Otto Moerbeek Date: Mon, 3 Oct 2022 06:52:44 +0000 (+0200) Subject: rec: fix build with --disable-dnstap, followup to #11903 X-Git-Tag: rec-4.9.0-alpha0~2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12049%2Fhead;p=thirdparty%2Fpdns.git rec: fix build with --disable-dnstap, followup to #11903 --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index cff6e03508..99549af899 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1264,11 +1264,17 @@ static StatsMap toRemoteLoggerStatsMap(const string& name) const auto pbasename = getPrometheusName(name); StatsMap entries; + std::vector> list; auto stats1 = broadcastAccFunction(pleaseGetRemoteLoggerStats); + list.emplace_back(stats1, "protobuf"); auto stats2 = broadcastAccFunction(pleaseGetOutgoingRemoteLoggerStats); + list.emplace_back(stats2, "outgoingProtobuf"); +#ifdef HAVE_FSTREAM auto stats3 = broadcastAccFunction(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);