if *COOKIE* is ``-`` send a random client cookie. Otherwise send the given cookie, which should be a hex string received from a server earlier.
traceid *TraceID*
include a TraceID and an empty SpanID value into the EDNS data. If TraceID is ``-``, a random TraceID is generated, otherwise it is a hex string.
+
Examples
--------
void extractOTraceIDs(const EDNSOptionViewMap& map, pdns::trace::Span& span)
{
// traceid gets set from edns options (if available and well-formed), otherwise random
- // parent_span_id gets set form edns options (if available and well-formed, otherwise it says cleared (no parent)
+ // parent_span_id gets set from edns options (if available and well-formed, otherwise it remains cleared (no parent))
// span_id gets inited randomly
bool traceidset = false;
if (const auto& option = map.find(EDNSOptionCode::OTTRACEID); option != map.end()) {
if (ssize_t len = recvmsg(fileDesc, &msgh, 0); len >= 0) {
eventTrace.clear();
eventTrace.setEnabled(SyncRes::s_event_trace_enabled != 0);
- // evenTrace use monotonic time, while OpenTelemetry uses absolute time. setEnabled()
- // estabslished the reference point, get an absolute TS as close as possible to the
+ // eventTrace uses monotonic time, while OpenTelemetry uses absolute time. setEnabled()
+ // established the reference point, get an absolute TS as close as possible to the
// eventTrace start of trace time.
auto traceTS = pdns::trace::timestamp();
eventTrace.add(RecEventTrace::ReqRecv);
}
// The event trace uses start-stop records which need to be mapped to opentrace spans, which is a
-// list of spans. Spans can refer to other spand as their parent. I have the feeling this code is
-// to complex and a brittle. Maybe we should add some extra info to the event trace records to make
-// is easier to map the event trace list to the open trace list of spans.
+// list of spans. Spans can refer to other spans as their parent. I have the feeling this code is
+// too complex and brittle. Maybe we should add some extra info to the event trace records to make
+// it easier to map the event trace list to the open trace list of spans.
std::vector<pdns::trace::Span> RecEventTrace::convertToOT(const Span& span) const
{
timespec realtime{};
std::vector<pdns::trace::Span> ret;
ret.reserve((d_events.size() / 2) + 1);
- // The parent of all Span
+ // The parent of all Spans
ret.emplace_back(span);
std::vector<SpanID> spanIDs; // mapping of span index in ret vector to SpanID
'help' : 'If set, event traces are collected and send out via protobuf logging (1), logfile (2), opentelemetry trace data (4) or a combination',
'doc' : '''
Enable the recording and logging of ref:`event traces`. This is an experimental feature and subject to change.
-Possible values are 0: (disabled), 1 (add information to protobuf logging messages), 2 (write to log), 4 (output OpenTelemetry Trace data in protobuf logging messages). Values can be added to get multiple types of logging simultaneously.
+Possible values are 0: (disabled), 1 (add information to protobuf logging messages), 2 (write to log), 4 (output OpenTelemetry Trace data in protobuf logging messages). Values can be added to get multiple types of logging simultaneously.
For example, 6 means: write to log and output OpenTelemetry Trace data in the protobuf stream.
''',
'versionadded': '4.6.0',
boost::optional<uint32_t> ednsVersion;
comboWriter->d_eventTrace.setEnabled(SyncRes::s_event_trace_enabled != 0);
- // evenTrace use monotonic time, while OpenTelemetry uses absolute time. setEnabled()
- // estabslished the reference point, get an absolute TS as close as possible to the
+ // eventTrace uses monotonic time, while OpenTelemetry uses absolute time. setEnabled()
+ // established the reference point, get an absolute TS as close as possible to the
// eventTrace start of trace time.
auto traceTS = pdns::trace::timestamp();
comboWriter->d_eventTrace.add(RecEventTrace::ReqRecv);