:param int ttl: Cache TTL for temporary failure replies
+.. function:: SetTraceAction(value)
+
+ .. versionadded:: 2.1.0
+
+ Enable or disable :doc:`OpenTelemetry tracing <../reference/ottrace>` for this query. Don't forget to use :func:`RemoteLogResponseAction` to actually send the Protobuf with the trace to a collector.
+ Subsequent rules are processed after this action.
+
+ Tracing has to be turned on globally as well using :func:`setOpenTelemetryTracing`.
+
+ :param bool value: Whether to enable or disable query tracing.
+
.. function:: SkipCacheAction()
.. deprecated:: 1.6.0
* ``levelPrefix=prefix``: string - Set the prefix for the log level. Default is ``prio``.
* ``timeFormat=format``: string - Set the time format. Supported values are ``ISO8601`` and ``numeric``. Default is ``numeric``.
+.. function:: setOpenTelemetryTracing(value)
+
+ .. versionadded:: 2.1.0
+
+ Enable or disable collection of OpenTelemetry trace data. This will allow the use of :func:`SetTraceAction` to trace queries. This can be called at runtime.
+
+ :param bool enable: true to enable, false to disable.
+
.. function:: setVerbose(verbose)
.. versionadded:: 1.8.0
Since version 2.1.0, when :program:`dnsdist` is built with ProtoBuf support, sent messages (using e.g. :func:`RemoteLogResponseAction`) can contain `OpenTelemetry traces <https://opentelemetry.io/docs/concepts/signals/traces>`__ data.
-To enable tracing, use :func:`setOpenTelemetryTracing(true) <setOpenTelemetryTracing>` in your configuration, or ``logging.open_telemetry_tracing`` to ``true`` in your YAML configuration.
+To enable tracing, use :func:`setOpenTelemetryTracing(true) <setOpenTelemetryTracing>` in your configuration, or ``logging.open_telemetry_tracing`` to ``true`` in your:ref:`YAML Logging Configuration <yaml-settings-LoggingConfiguration>`.
It is also possible to call :func:`setOpenTelemetryTracing` at runtime.
Once enabled, Rules can be used to turn on tracing on a per-query basis.
-Per-query tracing can be enabled using the :func:`SetTraceAction` or :func:`SetTraceResponseAction`. However :program:`dnsdist` captures some data before rules processing in order to have tracing information from before the rules are evaluated.
+Per-query tracing can be enabled using the :func:`SetTraceAction`. However, :program:`dnsdist` captures some data before rules processing in order to have tracing information from before the rules are evaluated.
When tracing is enabled in the query, :program:`dnsdist` stores start and end times of certain (but not all) functions that are called during the lifetime of the query and the response.
It is recommended to send the traces out through a RemoteLogger in ResponseRules, to capture as much information as possible.