From a5f96bfc8672aab327685d28ff774db2b27297a0 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 3 Oct 2022 08:52:44 +0200 Subject: [PATCH] rec: fix build with --disable-dnstap, followup to #11903 --- pdns/rec_channel_rec.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.47.2