From: Pieter Lexis Date: Wed, 8 Oct 2025 12:42:49 +0000 (+0200) Subject: docs(dnsdist): Add missing OT tracing functions X-Git-Tag: rec-5.4.0-alpha1~187^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=950f6af4324fdda55ae404572218cd213b767bca;p=thirdparty%2Fpdns.git docs(dnsdist): Add missing OT tracing functions --- diff --git a/pdns/dnsdistdist/docs/reference/actions.rst b/pdns/dnsdistdist/docs/reference/actions.rst index 8d5850fdbc..fbc50a9114 100644 --- a/pdns/dnsdistdist/docs/reference/actions.rst +++ b/pdns/dnsdistdist/docs/reference/actions.rst @@ -776,6 +776,17 @@ The following actions exist. :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 diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 4bfb998c93..1c96a7da6a 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -1414,6 +1414,14 @@ Status, Statistics and More * ``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 diff --git a/pdns/dnsdistdist/docs/reference/ottrace.rst b/pdns/dnsdistdist/docs/reference/ottrace.rst index 71feeb974c..4728745193 100644 --- a/pdns/dnsdistdist/docs/reference/ottrace.rst +++ b/pdns/dnsdistdist/docs/reference/ottrace.rst @@ -7,11 +7,11 @@ OpenTelemetry Tracing Since version 2.1.0, when :program:`dnsdist` is built with ProtoBuf support, sent messages (using e.g. :func:`RemoteLogResponseAction`) can contain `OpenTelemetry traces `__ data. -To enable tracing, use :func:`setOpenTelemetryTracing(true) ` in your configuration, or ``logging.open_telemetry_tracing`` to ``true`` in your YAML configuration. +To enable tracing, use :func:`setOpenTelemetryTracing(true) ` in your configuration, or ``logging.open_telemetry_tracing`` to ``true`` in your:ref:`YAML Logging Configuration `. 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.