From: Otto Moerbeek Date: Thu, 22 Jan 2026 15:26:16 +0000 (+0100) Subject: rec: harmonize with dnsdist PR #16741 wrt instance name X-Git-Tag: rec-5.5.0-alpha0~33^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=728e110e7fe268b8607ec9ffdb2c472deef9939a;p=thirdparty%2Fpdns.git rec: harmonize with dnsdist PR #16741 wrt instance name Signed-off-by: Otto Moerbeek --- diff --git a/pdns/protozero-trace.hh b/pdns/protozero-trace.hh index 2e53a34076..f2959014aa 100644 --- a/pdns/protozero-trace.hh +++ b/pdns/protozero-trace.hh @@ -748,16 +748,19 @@ struct TracesData return data; } - static TracesData boilerPlate(std::string&& service, std::vector&& spans, const std::vector& attributes, std::string& serverID) + static TracesData boilerPlate(std::string&& service, std::vector&& spans, const std::vector& 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)}}}}}; } };