return value;
}
-bool extractOTraceIDs(const EDNSOptionViewMap& map, pdns::trace::InitialSpanInfo& span)
+bool extractOTraceIDs(const EDNSOptionViewMap& map, EDNSOptionCode::EDNSOptionCodeEnum eoc, pdns::trace::InitialSpanInfo& span)
{
// traceid gets set from edns options (if available and well-formed)
// parent_span_id gets set from edns options (if available and well-formed)
- auto traceidset = extractOTraceIDs(map, EDNSOptionCode::OTTRACEIDS, span.trace_id, span.parent_span_id);
+ auto traceidset = extractOTraceIDs(map, eoc, span.trace_id, span.parent_span_id);
return traceidset;
}
* @param spanID will be set to the SpanID in the EDNS options, untouched otherwise
* @return true if a traceid was found in the EDNS options
*/
-bool extractOTraceIDs(const EDNSOptionViewMap& map, const EDNSOptionCode::EDNSOptionCodeEnum& eoc, pdns::trace::TraceID& traceID, pdns::trace::SpanID& spanID)
+bool extractOTraceIDs(const EDNSOptionViewMap& map, EDNSOptionCode::EDNSOptionCodeEnum eoc, pdns::trace::TraceID& traceID, pdns::trace::SpanID& spanID)
{
EDNSOptionCode::EDNSOptionCodeEnum realEOC = eoc;
if (realEOC == 0) {
const size_t size;
};
-bool extractOTraceIDs(const EDNSOptionViewMap& map, pdns::trace::InitialSpanInfo& span);
-bool extractOTraceIDs(const EDNSOptionViewMap& map, const EDNSOptionCode::EDNSOptionCodeEnum& eoc, pdns::trace::TraceID& traceID, pdns::trace::SpanID& spanID);
+bool extractOTraceIDs(const EDNSOptionViewMap& map, EDNSOptionCode::EDNSOptionCodeEnum eoc, pdns::trace::InitialSpanInfo& span);
+bool extractOTraceIDs(const EDNSOptionViewMap& map, EDNSOptionCode::EDNSOptionCodeEnum eoc, pdns::trace::TraceID& traceID, pdns::trace::SpanID& spanID);
} // namespace pdns::trace
If Table Based Proxy Mapping is active, the mapped address is used.
If a matching condition is found, the corresponding subconditions are evaluated.
-If all mentioned subconditions are satisfied, the condittion evalutes to ``true`` and OpenTelemetry Trace data is generated.
+If all mentioned subconditions are satisfied, the condition evaluates to ``true`` and OpenTelemetry Trace data is generated.
If a subcondition is absent, it is not relevant.
-The following subcondtions can be specified:
+The following subconditions can be specified:
- ``qnames``: a suffixmatch with the incoming qname is done against the suffixes specified in ``qnames``.
- ``qtypes``: the qtype of the incoming query must be listed in ``qtypes``
- ``qid``: the query id of the incoming query must match ``qid``.
-- ``edns_option_required``: the incoing query must have an EDSN option specifying the TraceID.
-- ``traceid_only`` if ``true`` only the TraceID is picked up from EDNS data (if present) and placed into the protobuf `openTelemetryTraceID` field; no detailed `openTelemetryData` is produced.
+- ``edns_option_required``: the incoming query must have an EDSN option specifying the TraceID.
+- ``traceid_only``: if ``true`` only the TraceID is picked up from EDNS data (if present) and placed into the protobuf `openTelemetryTraceID` field; no detailed `openTelemetryData` is produced.
-In the following example two conditions are specified:
+In the following example, two conditions are specified:
.. code-block:: yaml
Note that only the source IP is used to select a condition to evaluate.
It is undefined what happens if a subnet occurs multiple times in all :ref:`setting-yaml-logging.opentelemetry_trace_conditions`.
-To generate OpenTelemetry Trace information for all queries (the 5.3.x behaviour), the follwing condition can be used:
+To generate OpenTelemetry Trace information for all queries (matching the 5.3.x behaviour), the follwing condition can be used:
.. code-block:: yaml
dig +ednsopt=65500:00000102030405060708090a0b0c0d0e0fff ...
-The first 4 zeroes after the colon specify the version byte and a reserved byte, followed by a 16 byte (32 hex characters) TraceID.
+The first 4 zeroes after the colon specify the version byte and a reserved byte, followed by a 16 bytes (32 hex characters) TraceID.
Note that the EDNS option number 65500 is subject to change in the future.
-To also add a parent SpanID to the EDNS value, append 8 bytes (16 hex characters) more.
+To also add a parent SpanID to the EDNS value, append 8 more bytes (16 hex characters.)
Example OpenTelemetry Trace in in JSON representation
"""""""""""""""""""""""""""""""""""""""""""""""""""""
ecsParsed = true;
if (SyncRes::eventTraceEnabled(SyncRes::event_trace_to_ot)) {
- bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, otTrace);
+ bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::OTTRACEIDS, otTrace);
if (!matchOTConditions(eventTrace, t_OTConditions, mappedSource, qname, qtype, ntohs(headerdata->id), ednsFound) && SyncRes::eventTraceEnabledOnly(SyncRes::event_trace_to_ot)) {
eventTrace.setEnabled(false);
}
qnameParsed = true;
if (SyncRes::eventTraceEnabled(SyncRes::event_trace_to_ot)) {
- bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, comboWriter->d_otTrace);
+ bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::OTTRACEIDS, comboWriter->d_otTrace);
if (SyncRes::eventTraceEnabledOnly(SyncRes::event_trace_to_ot) && !matchOTConditions(comboWriter->d_eventTrace, t_OTConditions, comboWriter->d_mappedSource, qname, qtype, ntohs(comboWriter->d_mdp.d_header.id), ednsFound)) {
comboWriter->d_eventTrace.setEnabled(false);
}