]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add allow non-default argument name 16190/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 15 Oct 2025 09:46:50 +0000 (11:46 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 15 Oct 2025 10:06:57 +0000 (12:06 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/rec-eventtrace.cc
pdns/recursordist/rec-eventtrace.hh
pdns/recursordist/syncres.cc

index 8ec7fbbbb7c704e76d1ae4874eeb772488d393a5..42c237f81682acc908b98701cefdb7e0d169d18a 100644 (file)
@@ -52,7 +52,7 @@ static void addValue(const RecEventTrace::Entry& event, Span& work, bool start)
   if (std::holds_alternative<std::nullopt_t>(event.d_value)) {
     return;
   }
-  string key = start ? "arg" : "result";
+  string key = start ? event.d_valueName : "result";
   if (std::holds_alternative<bool>(event.d_value)) {
     work.attributes.emplace_back(KeyValue{std::move(key), {std::get<bool>(event.d_value)}});
   }
index 0a28b8cb9550b6e28147a42e55ae95c22ccce226..31bb509f0c0bb68dad007b5a86970646fdad1105 100644 (file)
@@ -144,6 +144,7 @@ public:
     Value_t d_value;
     std::vector<std::pair<string, Value_t>> d_extraValues;
     std::string d_custom;
+    std::string d_valueName{"arg"};
     int64_t d_ts;
     size_t d_parent;
     size_t d_matching;
@@ -230,6 +231,15 @@ public:
     return add(eventType, Value_t(value), start, match, 0);
   }
 
+  void setValueName(size_t index, const std::string& name)
+  {
+    assert(d_status != Invalid);
+    if (d_status == Disabled) {
+      return;
+    }
+    d_events.at(index).d_valueName = name;
+  }
+
   void addExtraValues(size_t index, std::vector<std::pair<std::string, Value_t>>&& values)
   {
     assert(d_status != Invalid);
index 5c4c9d74de05e432220236e10b014701cb2d128f..c39416421cc733e779516f87119c036cbb598394 100644 (file)
@@ -5454,7 +5454,8 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname,
       s_ecsqueries++;
     }
     auto match = d_eventTrace.add(RecEventTrace::AuthRequest, qname.toLogString(), true, 0);
-    d_eventTrace.addExtraValues(match, {{"query.qtype", qtype.toString()}, {"auth.address", remoteIP.toStringWithPortExcept(53)}});
+    d_eventTrace.setValueName(match, "query.qname");
+    d_eventTrace.addExtraValues(match, {{"query.qtype", qtype.toString()}, {"auth.address", remoteIP.toStringWithPortExcept(53)}, {"auth.nsname", nsName.toLogString()}});
     updateQueryCounts(prefix, qname, remoteIP, doTCP, doDoT);
     resolveret = asyncresolveWrapper(LogObject(prefix), remoteIP, d_doDNSSEC, qname, auth, qtype.getCode(),
                                      doTCP, sendRDQuery, &d_now, ednsmask, &lwr, &chained, nsName); // <- we go out on the wire!