#ifdef DISABLE_PROTOBUF
return d_OTTracer;
#else
- if (!d_OTTracingEnabled || d_OTTracer != nullptr) {
+ if ((d_OTTracingEnabledInConfiguration && !*d_OTTracingEnabledInConfiguration) || d_OTTracer != nullptr) {
return d_OTTracer;
}
if (dnsdist::configuration::getCurrentRuntimeConfiguration().d_openTelemetryTracing) {
// OpenTelemetry tracing is enabled, but we don't have a tracer yet
+ d_OTTracingEnabledInConfiguration = true;
d_OTTracer = pdns::trace::dnsdist::Tracer::getTracer();
}
else {
- d_OTTracingEnabled = false;
+ d_OTTracingEnabledInConfiguration = false;
}
return d_OTTracer;
#endif
uint16_t udpPayloadSize{0}; // Max UDP payload size from the query // 2
uint16_t sendTraceParentToDownstreamID{0}; // Whether or not to add a TRACEPARENT EDNS option to downstreams, set to non-0 for the EDNS Option ID
std::optional<bool> dnssecOK;
+#ifndef DISABLE_PROTOBUF
+ std::optional<bool> d_OTTracingEnabledInConfiguration; // Whether OpenTelemetry tracing is enabled in the configuration. This prevents having to check the configuration several times for the same query
+#endif /* DISABLE_PROTOBUF */ //
dnsdist::Protocol protocol; // 1
uint8_t restartCount{0}; // 1
bool ednsAdded{false};
bool staleCacheHit{false};
bool tracingEnabled{false}; // Whether or not Open Telemetry tracing is enabled for this query
bool rulesAppliedToQuery{false}; // Whether applyRulesToQuery has been called for the query, used to determine if we need to trace
- bool d_OTTracingEnabled{true}; // Whether OpenTelemetry tracing is enabled in the configuration. This prevents having to check the configuration several times for the same query
struct rulesAppliedToQuerySetter
{
rulesAppliedToQuerySetter(bool& pastProcessRules) :