OpenTelemetry Traces
^^^^^^^^^^^^^^^^^^^^
-OpenTelemetry Traces are generated by setting :ref:`setting-yaml-recursor.event_trace_enabled` or by using the :doc:`rec_control <manpages/rec_control.1>` subcommand ``set-event-trace-enabled`` to a value that includes 4.
+OpenTelemetry Traces are generated by setting :ref:`setting-yaml-recursor.event_trace_enabled` or by using the :doc:`rec_control <manpages/rec_control.1>` subcommand ``set-event-trace-enabled``.
+:ref:`setting-yaml-recursor.event_trace_enabled` describes which values enable OpenTelemetry Traces.
:program:`Recursor` will set the ``openTelemetryData`` field of ``dnsmessage.proto`` messages generated to contain OpenTelemetry Traces, encoded as Protobuf data.
The encoding used is defined in https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto.
OpenTelemetry Trace Conditions
""""""""""""""""""""""""""""""
-Starting with version 5.4.0, the OpenTelemetry Trace data is only generated if :ref:`setting-yaml-recursor.event_trace_enabled` includes 4 *and* a matching condition from :ref:`setting-yaml-logging.opentelemetry_trace_conditions` evaluates to ``true``.
+Starting with version 5.4.0, the OpenTelemetry Trace data is only generated if :ref:`setting-yaml-recursor.event_trace_enabled` is set to enable OpenTelemetry Tracing *and* a matching condition from :ref:`setting-yaml-logging.opentelemetry_trace_conditions` evaluates to ``true``.
For a match to occur, the origin address of the query should match a subnet in `acls`.
-If the proxy protocol is used, the source specified by the proxy protocol header is used to match.
-If Table Based Proxy Mapping is active, the mapped address is used.
+If the :ref:`Proxy Protocol <setting-yaml-incoming.proxy_protocol_from>` is used, the source address included the proxy protocol header is used to match.
+If :doc:`lua-config/proxymapping` 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 condition evaluates to ``true`` and OpenTelemetry Trace data is generated.
.. code-block:: yaml
- logging:
- opentelemetry_trace_conditions:
- - acls: [127.0.0.1, '::1']
- - acls: [192.168.178.0/24]
- qnames: [a.very.specific.suffix]
- qtypes: ['A', 'AAAA']
- qid: 1234
- edns_option_required: true
+ recursor:
+ event_trace_enabled: 4
+ logging:
+ protobuf_server:
+ - servers: [127.0.0.1:9999]
+ opentelemetry_trace_conditions:
+ - acls: [127.0.0.1, '::1']
+ - acls: [192.168.178.0/24]
+ qnames: [a.very.specific.suffix]
+ qtypes: ['A', 'AAAA']
+ qid: 1234
+ edns_option_required: true
The first condition specifies that all queries coming from ``127.0.0.1`` or ``::1`` should generate trace information.
No subconditions are relevant.
Queries coming from an IP not matching any of the mentioned subnets will not generate OpenTelemetry Trace information.
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`.
+If a subnet occurs multiple times in all :ref:`setting-yaml-logging.opentelemetry_trace_conditions`, only that last condition mentioned is effective.
To generate OpenTelemetry Trace information for all queries (matching the 5.3.x behaviour), the following condition can be used: