Checks whether OpenTelemetry tracing is active. This can be useful
to avoid unnecessary computation when tracing is inactive.
Usage
is_tracing_enabled(tracer = NULL)
Value
TRUE is OpenTelemetry tracing is active, FALSE otherwise.
Arguments
tracer
Tracer object (otel_tracer). It can also be a tracer
name, the instrumentation scope, or NULL for determining the tracer
name automatically. Passed to get_tracer() if not a tracer object.
Details
It calls get_tracer() with name and then it calls the tracer's
$is_enabled() method.
See Also
Other OpenTelemetry trace API:
Zero Code Instrumentation,
end_span(),
local_active_span(),
start_local_active_span(),
start_span(),
tracing-constants,
with_active_span()