}
ede.clearExisting = clearExistingEntries.value_or(true);
if (ede.clearExisting) {
- dnsQuestion.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({ede}));
+ dnsQuestion.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({std::move(ede)}));
}
else {
if (!dnsQuestion.ids.d_extendedErrors) {
- dnsQuestion.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({ede}));
+ dnsQuestion.ids.d_extendedErrors = std::make_unique<std::vector<dnsdist::edns::SetExtendedDNSErrorOperation>>(std::initializer_list<dnsdist::edns::SetExtendedDNSErrorOperation>({std::move(ede)}));
}
else {
- dnsQuestion.ids.d_extendedErrors->emplace_back(ede);
+ dnsQuestion.ids.d_extendedErrors->emplace_back(std::move(ede));
}
}
});
std::ostringstream output;
std::string instanceLabel; // MUST be empty when instance label is not requested
{
- auto rtc = dnsdist::configuration::getCurrentRuntimeConfiguration();
+ const auto& rtc = dnsdist::configuration::getCurrentRuntimeConfiguration();
instanceLabel = rtc.d_prometheusAddInstanceLabel ? "instance=\"" + rtc.d_server_id + "\"" : "";
}
static const std::set<std::string> metricBlacklist = {"special-memory-usage", "latency-count", "latency-sum"};