return ret;
}
-std::optional<pdns::trace::dnsdist::Tracer::Closer> InternalQueryState::getRulesCloser([[maybe_unused]] const std::string_view& ruleName, [[maybe_unused]] const std::string_view& parentSpanName)
+std::optional<pdns::trace::dnsdist::Tracer::Closer> InternalQueryState::getRulesCloser([[maybe_unused]] const std::string_view& ruleName, [[maybe_unused]] const std::string_view& parentSpanName, [[maybe_unused]] const std::string& ruleType)
{
std::optional<pdns::trace::dnsdist::Tracer::Closer> ret(std::nullopt);
#ifndef DISABLE_PROTOBUF
// Should tracing be disabled, *but* we have not processed query rules, we will still return a closer if tracing is globally enabled
if (auto tracer = getTracer(); tracer != nullptr && (tracingEnabled || !rulesAppliedToQuery)) {
auto parentSpanID = d_OTTracer->getLastSpanIDForName(std::string(parentSpanName));
- auto name = prefix + std::string(ruleName);
+ auto name = ruleType + prefix + std::string(ruleName);
ret = std::optional<pdns::trace::dnsdist::Tracer::Closer>(d_OTTracer->openSpan(name, parentSpanID));
}
#endif
std::optional<pdns::trace::dnsdist::Tracer::Closer> getCloser([[maybe_unused]] const std::string_view& name, [[maybe_unused]] const SpanID& parentSpanID);
std::optional<pdns::trace::dnsdist::Tracer::Closer> getCloser([[maybe_unused]] const std::string_view& name, [[maybe_unused]] const std::string_view& parentSpanName);
std::optional<pdns::trace::dnsdist::Tracer::Closer> getCloser([[maybe_unused]] const std::string_view& name);
- std::optional<pdns::trace::dnsdist::Tracer::Closer> getRulesCloser([[maybe_unused]] const std::string_view& ruleName, [[maybe_unused]] const std::string_view& parentSpanName);
+ std::optional<pdns::trace::dnsdist::Tracer::Closer> getRulesCloser([[maybe_unused]] const std::string_view& ruleName, [[maybe_unused]] const std::string_view& parentSpanName, [[maybe_unused]] const std::string& ruleType);
InternalQueryState()
{
DNSResponseAction::Action action = DNSResponseAction::Action::None;
std::string ruleresult;
+ static const std::string ruleType = "Response";
for (const auto& rrule : respRuleActions) {
- auto ruleCloser = dnsResponse.ids.getRulesCloser(rrule.d_name, __func__); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
+ auto ruleCloser = dnsResponse.ids.getRulesCloser(rrule.d_name, __func__, ruleType); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
if (rrule.d_rule->matches(&dnsResponse)) {
++rrule.d_rule->d_matches;
action = (*rrule.d_action)(&dnsResponse, &ruleresult);
bool drop = false;
auto closer = dnsQuestion.ids.getCloser(__func__); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
+ static const std::string ruleType; // Empty string
for (const auto& rule : rules) {
- auto ruleCloser = dnsQuestion.ids.getRulesCloser(rule.d_name, __func__); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
+ auto ruleCloser = dnsQuestion.ids.getRulesCloser(rule.d_name, __func__, ruleType); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
if (!rule.d_rule->matches(&dnsQuestion)) {
continue;
funcs.add("processResponse")
if hasRemoteLogResponseAction:
- funcs.add("Rule: Do PB logging")
+ funcs.add("ResponseRule: Do PB logging")
if useTCP:
funcs.add("IncomingTCPConnectionState::handleQuery")
hasRemoteLogResponseAction=False,
useTCP=useTCP,
extraFunctions={
- "Rule: Drop",
+ "ResponseRule: Drop",
},
)