]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: harmonize with dnsdist PR #16741 wrt instance name 16756/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 22 Jan 2026 15:26:16 +0000 (16:26 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 22 Jan 2026 15:26:59 +0000 (16:26 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/protozero-trace.hh

index 2e53a34076f1e51a5d0e2a989c0863f6de8eca2f..f2959014aac3b2c7667ec123fef32d1641e89c0b 100644 (file)
@@ -748,16 +748,19 @@ struct TracesData
     return data;
   }
 
-  static TracesData boilerPlate(std::string&& service, std::vector<Span>&& spans, const std::vector<KeyValue>& attributes, std::string& serverID)
+  static TracesData boilerPlate(std::string&& service, std::vector<Span>&& spans, const std::vector<KeyValue>& attributes, const std::string& serverID)
   {
     auto& spanAttrs = spans.at(0).attributes;
     spanAttrs.insert(spanAttrs.end(), attributes.begin(), attributes.end());
-    auto host = getHostname();
-    std::string hostname = host.value_or("unset");
     InstrumentationScope scope{
-      .name = "rec", .version = VERSION, .attributes = {{"hostname", {hostname}}, {"server.id", {serverID}}}};
+      .name = "rec", .version = VERSION};
     return TracesData{
-      .resource_spans = {pdns::trace::ResourceSpans{.resource = {.attributes = {{"service.name", {{std::move(service)}}}}}, .scope_spans = {{.scope = std::move(scope), .spans = std::move(spans)}}}}};
+      .resource_spans = {pdns::trace::ResourceSpans{
+        .resource = {
+          .attributes = {
+            {"service.name", {{std::move(service)}}},
+            {"instance", {serverID}}}},
+        .scope_spans = {{.scope = std::move(scope), .spans = std::move(spans)}}}}};
   }
 };